Search Results

Search found 5961 results on 239 pages for 'wpf'.

Page 22/239 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • WPF Ribbon controls book

    - by Greens
    Is there any book or links that I can read some tutorial about the WPF ribbon control. I need to get some basics . Also can any one recommend good book in WPF or a starter kit. Thanks.

    Read the article

  • Good resources for learning WPF

    - by user185040
    I am very new to WPF and I am interested in learning it. I have gone through some tutorials, but I am looking for a website or book containing projects/assignments along with solutions so that you can code and learn. As I work through a project, I'd like to be able to refer to a solution in case I get stuck somewhere. Can someone please share any links/material if you have which can give me some WPF Projects/assignments to work on along with solution. Thanks.

    Read the article

  • WPF documentation exists on MSDN?

    - by jedd
    Am I missing something or is there no documentation of WPF controls? When I look at MSDN, it says to reference System.Windows.Controls (http://msdn.microsoft.com/en-us/library/ms752069.aspx), but this is for winforms? Where can I find the WPF object model?

    Read the article

  • WPF sample applications

    - by ASDFdotASPX
    Hi, Are there any WPF sample applications that showoff the 'coolness' of WPF? I'm hoping to see some examples of the UI capabilities etc., and general structure and best practices. (oh, and the install shouldn't be too elaborate hehe)

    Read the article

  • WPF on a iX104 Tablet PC - efficient enough?

    - by Casimodo72
    Hi, I'm considering to use WPF for an application running on an iX104 (unfortunately I don't have one of those yet). Do you guys think that this combination would be efficient enough? Or is WPF just to slow for such a machine, so better stick with WinForms? Relevant specs of the iX104: Intel Pentium U2500 CoreDuo 2x 1.2 GHz 1 GB RAM, optional 2 GB 10.4" TFT, XGA 1024x768 Regards, Kasimier

    Read the article

  • Define global textbox (or other control) width in WPF

    - by John B
    I'd like to be able to maintain the width of controls globally throughout my WPF application. Previously in winforms world I'd override onload in a base form and iterate through all controls and containers and determine the type of controls and set the dimensions accordingly. I guess I could do the same in WPF but is there any better way to do this?

    Read the article

  • No Main() in WPF?

    - by Luminose
    I am very beginner when it comes to programming but I was sure that one of the universal rules was that an program starts with Main(). I do not see one when I create a WPF project. Is Main() simply named something differently in WPF?

    Read the article

  • WPF TextBox - don't hide the selection

    - by Justin R
    WPF's TextBox (System.Windows.Controls.TextBox) appears to highlight selected text only when it has the focus. I need to make a TextBox continue to show the selection when focus is lost. In a standard Win32 EDIT control I could achieve this with ES_NOHIDESEL. How can I get the equivalent in WPF?

    Read the article

  • How do I implement movement in a WPF Adventure game?

    - by ZeroPhase
    I'm working on making a short WPF adventure game. The only major hurdle I have right now is how to animate objects on the screen correctly. I've experimented with DoubleAnimation and ThicknessAnimation both enable movement of the character, but the speed is a bit erratic. The objects I'm trying to move around are labels in a grid, I'm checking the mouse's position in terms of the canvas I have the grid in. Does anyone have any suggestions for coding the movement, while still allowing mouse clicks to pick up items when needed? It would be nice if I could continue using the Visual Studio GUI Editor. By the way, I'm fine with scrapping labels in a grid for a more ideal object to manipulate. Here's my movement code: ThicknessAnimation ta = new ThicknessAnimation(); The event handling movement: private void Hansel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ta.FillBehavior = FillBehavior.HoldEnd; ta.From = Hansel.Margin; double newX = Mouse.GetPosition(PlayArea).X; double newY = Mouse.GetPosition(PlayArea).Y; if (newX < Convert.ToDouble(Hansel.Margin.Left)) { //newX = -1 * newX; ta.To = new Thickness(0, newY, newX, 0); } else if (newY < Convert.ToDouble(Hansel.Margin.Top)) { newY = -1 * newY; } else { ta.To = new Thickness(newX, newY, 0, 0); } ta.Duration = new Duration(TimeSpan.FromSeconds(2)); Hansel.BeginAnimation(Grid.MarginProperty, ta); } ScreenShot with annotations: http://i1118.photobucket.com/albums/k608/sealclubberr/clickToMove_zps9d4a33cc.png ScreenShot with example movement: http://i1118.photobucket.com/albums/k608/sealclubberr/clickToMove_zps51f2359f.jpg

    Read the article

  • WPF: TreeViewItem bound to an ICommand

    - by Richard
    Hi All, I am busy creating my first MVVM application in WPF. Basically the problem I am having is that I have a TreeView (System.Windows.Controls.TreeView) which I have placed on my WPF Window, I have decide that I will bind to a ReadOnlyCollection of CommandViewModel items, and these items consist of a DisplayString, Tag and a RelayCommand. Now in the XAML, I have my TreeView and I have successfully bound my ReadOnlyCollection to this. I can view this and everything looks fine in the UI. The issue now is that I need to bind the RelayCommand to the Command of the TreeViewItem, however from what I can see the TreeViewItem doesn't have a Command. Does this force me to do it in the IsSelected property or even in the Code behind TreeView_SelectedItemChanged method or is there a way to do this magically in WPF? This is the code I have: <TreeView BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TreeView.Items> <TreeViewItem Header="New Commands" ItemsSource="{Binding Commands}" DisplayMemberPath="DisplayName" IsExpanded="True"> </TreeViewItem> </TreeView.Items> and ideally I would love to just go: <TreeView BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TreeView.Items> <TreeViewItem Header="New Trade" ItemsSource="{Binding Commands}" DisplayMemberPath="DisplayName" IsExpanded="True" Command="{Binding Path=Command}"> </TreeViewItem> </TreeView.Items> Does someone have a solution that allows me to use the RelayCommand infrastructure I have. Thanks guys, much appreciated! Richard

    Read the article

  • Recommendations on developing a WPF application without using MVVM or similar

    - by Metro Smurf
    We were building out the next version of an in-house thick-client application using WPF/Prism (Composite Application Library). As we were nearly done with the client our team was put under new management and shortly thereafter: We were then directed to drop the Prism framework to keep things simple. This includes not using any type of Inversion of Control. We were directed to build out the WPF application without using MVVM or similar; and more along the lines of a traditional WinForm application. The idea is that if a developer sees a control in Visual Studio’s designer view, then (s)he should be able to click on the control and see exactly what it's doing without having to traverse through a view-model (or similar). We have now been tasked with building out the WPF application using one primary Window, use a Frame Control to contain the content, and use a Ribbon outside of the frame for the menu items. Reason we were provided to use Frame Control: a. We will show a view in the Frame with a Page (not a user control) and then load the page in the Frame. b. When a new view is to be shown in the Frame, the current view (Page) will be closed/disposed and the new view (Page) will take its place in the Frame. c. When a developer looks at the Page in design view, (s)he will be able to click on any control and see exactly what is being done. Given the restrictions of 1 and 2 above, we’d like to present another method of building out the application that: Can be presented as an alternative to using the “Frame Methodology” (item 3 above) but still provides the same type of functionality. Does not use MVVM (see #1 and #2 above). Provided the direction we’ve been given, any suggestions as to an alternative we can present? I’d request that the responses be kept on the professional level and thank you in advance.

    Read the article

  • How to keep relative position of WPF elements on background image

    - by Masterfu
    Hi folks, I am new to WPF, so the answer to the following question might be obvious, however it isn't to me. I need to display an image where users can set markers on (As an example: You might want to mark a person's face on a photograph with a rectangle), however the markers need to keep their relative position when scaling the image. Currently I am doing this by using a Canvas and setting an ImageBrush as Background. This displays the image and I can add elements like a Label (as replacement for a rectangle) on top of the image. But when I set a label like this, it's position is absolute and so when the underlying picture is scaled (because the user drags the window larger) the Label stays at it's absolute position (say, 100,100) instead of moving to the new position that keeps it "in sync" with the underlying image. To cut the matter short: When I set a marker on a person's eye, it shouldn't be on the person's ear after scaling the window. Any suggestions on how to do that in WPF? Maybe Canvas is the wrong approach in the first place? I could keep a collection of markers in code and recalculate their position every time the window gets resized, but I hope there is a way to let WPF do that work for me :-) I am interested in hearing your opinions on this. Thanks

    Read the article

  • WPF Background Thread Invocation

    - by jeffn825
    Maybe I'm mis-remembering how Winforms works or I'm overcomplicating the hell out of this, but here's my problem. I have a WPF client app application that talks to a server over WCF. The current user may "log out" of the WPF client, which closes all open screens, leaves only the navigation pane, and minimizes the program window. When the user re-maximizes the program window, they are prompted to log in. Simple. But sometimes things happen on background threads - like every 5 minutes the client tries to make a WCF calls that refreshes some cached data. And what if the user is logged out when this 5 minute timer triggers? Well, then the user should be prompted to log back in...and this must of course happen on the UI thread. private static ISecurityContext securityContext; public static ISecurityContext SecurityContext { get { if (securityContext == null) { // Login method shows a window and prompts the user to log in Application.Current.Dispatcher.Invoke((Action)Login); } return securityContext; } } So far so good, right? But what happens when multiple threads hit this spot of code? Well, my first intuition was that since I'm syncrhonizing across the Application.Current.Dispatcher, I should be fine, and whichever thread hit first would be responsible for showing the login form and getting the user logged in... Not the case... Thread 1 will hit the code and call ShowDialog on the login form Thread 2 will also hit the code and will call Login as soon as Thread 1 has called ShowDialog, since calling ShowDialog unblocked Thread 1 (I believe because of the way the WPF message pump works) All I want is a synchronized way of getting the user logged back into the application...what am I missing here? Thanks in advance.

    Read the article

  • Why isn't my WPF Datagrid showing data?

    - by Edward Tanguay
    This walkthrough says you can create a WPF datagrid in one line but doesn't give a full example. So I created an example using a generic list and connected it to the WPF datagrid, but it doesn't show any data. What do I need to change on the code below to get it to show data in the datagrid? ANSWER: This code works now: XAML: <Window x:Class="TestDatagrid345.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:local="clr-namespace:TestDatagrid345" Title="Window1" Height="300" Width="300" Loaded="Window_Loaded"> <StackPanel> <toolkit:DataGrid ItemsSource="{Binding}"/> </StackPanel> </Window> Code Behind: using System.Collections.Generic; using System.Windows; namespace TestDatagrid345 { public partial class Window1 : Window { private List<Customer> _customers = new List<Customer>(); public List<Customer> Customers { get { return _customers; }} public Window1() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { DataContext = Customers; Customers.Add(new Customer { FirstName = "Tom", LastName = "Jones" }); Customers.Add(new Customer { FirstName = "Joe", LastName = "Thompson" }); Customers.Add(new Customer { FirstName = "Jill", LastName = "Smith" }); } } }

    Read the article

  • Handling events from user control containing a WPF textbox

    - by Tom
    I've been successful in putting a WPF textbox into an existing windows form using ElementHost and a user control. It looks like the following: Public Class MyUserControl Private _elementHost as ElementHost = New ElementHost Private _wpfTextbox as System.Windows.Controls.Textbox = New System.Windows.Controls.Textbox Public Sub New() Me.Controls.Add(_elementHost) _elementHost.Dock = DockStyle.Fill _elementHost.Child = _wpfTextbox _wpfTextbox.SpellCheck.IsEnabled = True End Sub End Class Now, when I put this user control onto a windows form, it accepts keyboard input and the form itself can get text from the textbox. However, when I try to handle keypress (or keydown, keyup) events from the user control, nothing happens. I've looked into this problem and did a bit of research but now I'm a little confused as to what I really need to be looking at. The following are the topics that I am somewhat confused about. HwndSource Relaxed delegates WPF routed events If I am interpreting everything correctly, input from WPF textboxes are handled differently compared to regular form textboxes. It seems like both aren't compatible with each other but there must be some way to "pass" keys from one to another? I'd appreciate any help.

    Read the article

  • Switching to WPF, the best use of time at Visual Studio Launch 2010

    - by Stewbob
    Yes, this is a programming-related question, if a little indirectly (that's why I marked it Community Wiki right away). For better or worse, I am switching from Winforms to WPF in April. I am also going to be in attendance at the Visual Studio Launch in Las Vegas. I have a real need to get up to speed quickly in WPF, so my question is: What sessions are going to be the best use of my time? I've got some picked out already, but I'm looking for some more advice on how to wade through all the marketing fluff and get some real educational value out of these few days. I have not been to one of these events before, so I don't really know how much is marketing hype, and how much is solid content. A couple of the workshops look interesting (VPR02 and VPS02), but I don't know enough about the actual content of these to justify the extra expense right now. Any thoughts there would be appreciated. And yes, I do have WPF learning planned other than just these few days in Vegas, but since I'm going to be there anyway, I want to learn as much as I can in the time available.

    Read the article

  • C# / Silverlight / WPF / Fast rendering lots of circles

    - by Walt W
    I want to render a lot of circles or small graphics within either silverlight or wpf (around 1000-10000) as fast and as frequently as possible. If I have to go to DX or OGL, that's fine, but I'm wondering about doing this within either of those two frameworks first (read: it's OK if an answer is WPF-only or Silverlight-only). Also, if there is a way to access DX through WPF and render on a surface that way, I would be interested in that as well. So, what's the fastest way to draw a load of circles? They can be as plain as necessary, but they do need to have a radius. Currently I'm using DrawingVisual and a DrawingContext.DrawEllipse() command for each circle, then rendering the visual to a RenderTargetBItmap, but it becomes very slow as the number of circles rises. By the way, these circles move every frame, so caching isn't really an option unless you're going to suggest caching the individual circles . . . But their sizes are dynamic, so I'm not sure that's a great approach.

    Read the article

  • Assembly-wide / root-level styles in WPF class library

    - by WarpedBoard
    I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on http://dotupdate.wordpress.com/2007/12/05/how-to-add-a-wpf-control-library-template-to-visual-c-express-2008/). I've created several windows, and am now attempting to create a common style set for them. However, as it's a class library (instead of a WPF app), I don't have an app.xaml (and its contained Application & corresponding Application.Resources) in which to store these styles for global access. So: How can I create a top-level set of style definitions that'll be seen by all xaml files in the assembly, given that I do not have app.xaml (see above)? And/or is it possible to add a working app.xaml to a class library? FYI, I did try creating a ResourceDictionary in a ResourceDictionary.xaml file, and include it in each window within a "Window.Resources" block. That turned out to solve the styling of Buttons, etc... but not for the enclosing Window. I can put 'Style="{StaticResource MyWindowStyle}"' in the Window's opening block, and it compiles and shows up in the VS Design window fine, but during actual runtime I get a parse exception (MyWindowStyle could not be found; I'm guessing Visual Studio sees the dictionary included after the line in question, but the CRL does things more sequentially and therefore hasn't loaded the ResourceDictionary yet).

    Read the article

  • Bind an Incode DataTemplate in WPF

    - by Mike Bynum
    I have a WPF Application which is using MVVM. I know that there ways of doing this in XAML but I am working on a plugin architecture and came up with a solution where a plugin exposes it's viewmodel to my plugin host's viewmodel and it's datatemplate. I want to leave the lifetime management of the plugin view up to WPF. I have tried having the plugins expose a UserControl but ran into issues when WPF decided to dispose of my UserControl so I would not reattach it without weird hacky work arounds. I am having issues getting some sort of binding working to where i can bind a control to the data and it's template to my data template. I have a ViewModel which looks something like: public class MyViewModel { public DataTemplate SelectedTemplate{ get; set;} public object SelectedViewModel {get; set;} } The selected template and viewmodel are determined somewhere else in the code but are irrelevant to my question. My question is how i can bind to a DataTemplate so that I know how to display the data shown in the SelectedViewModel. The DataTemplate is a DataTemplate created incode which respresents: <DataTemplate DataType="{x:Type vm:MyViewModel}"> <v:MyUserControl /> </DataTemplate> I have tried: <UserControl Template="{Binding Path=SelectedTemplate}" Content="{Binding Path=SelectedViewModel"} /> But UserControl expects a control template and not a data template.

    Read the article

  • StackPanel location changes at runtime

    - by Vinjamuri
    I have a ToolBar WPF control which has a Stackpanel docked to right. I use this toolbar control in 3 other WPF controls by adding in the XAML. When I verify in the XAML the Stackpanel location is same for all 3 controls. But when I run my application, for one of the 3 controls, the StackPanel in the ToolBar control shifts to left. <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" Name="stackButtons" > Any idea? Appreciate your help..

    Read the article

  • How to add global exception handling to a add-in dll?

    - by redjackwong
    Here's my context: I am writing a WPF add-in for an application. This Application's main thread is unmanaged. I want to add a global exception handling system for this add-in to handle any unhandled exceptions. Here's what I've tried but not working: I cannot add a try-catch block to my Application.Run() code line. Because I am an add-in, that code fragment is in the application. System.Windows.Forms.Application.ThreadException is not working too. There might not be an WinForm Application exists. (WPF hosting in unmanaged code.) AppDomain.CurrentDomain.UnhandledException is not working too. Because maybe it's handled by the Application itself. It just doesn't enter my code. So, any ideas for this situation?

    Read the article

  • Issue with mouse move event

    - by Vinjamuri
    I have a WPF control1 (has a moving control) that is hosted through elementhost on a windows form. My aim is to capture the mouse move events for the elementhost. I found out from the following link that MouseMove fires when Control moves under mouse while mouse stands still. http://social.msdn.microsoft.com/Forums/en/wpf/thread/56e7b331-ac6f-4d62-a83b-c09009b79fa0 I am getting fake mouse move events for elementhost. In order to fix this issue, I added a button on top of elementhost and set its Visible property to Hidden. Still I get fake mouse move events.. How to fix this issue? Is there any workaround? Appreciate your help...

    Read the article

  • Using XAML + designer to edit Plain Old CLR Objects?

    - by Joe White
    I want to write a POCO in XAML, and use a DataTemplate to display that object in the GUI at runtime. So far, so good; I know how to do all that. Since I'll already have a DataTemplate that can transform my POCO into a WPF visual tree, is there any way to get the Visual Studio designer to play along, and have the Design View show me the POCO+DataTemplate's resulting GUI, as I edit the POCO's XAML? (Obviously the designer wouldn't know how to edit the "design view"; I wouldn't expect the Toolbox or click-and-drag to work on the design surface. That's fine -- I just want to see a preview as I edit.) If you're curious, the POCOs in question would be level maps for a game. (At this point, I'm not planning to ship an end-user map editor, so I'll be doing all the editing myself in Visual Studio.) So the XAML isn't WPF GUI objects like Window and UserControl, but it's still not something where I would want to blindly bang out some XAML and hope for the best. I want to see what I'm doing (the GUI map) as I'm doing it. If I try to make a XAML file whose root is my map object, the designer shows "Intentionally Left Blank - The document root element is not supported by the visual designer." It does this even if I've defined a DataTemplate in App.xaml's <Application.Resources>. But I know the designer can show my POCO, when it's inside a WPF object. One possible way of accomplishing what I want would be to have a ScratchUserControl that just contains a ContentPresenter, and write my POCO XAML inside that ContentPresenter's Content property, e.g.: <UserControl ...> <ContentPresenter> <ContentPresenter.Content> <Maps:Map .../> </ContentPresenter.Content> </ContentPresenter> </UserControl> But then I would have to be sure to copy the content back out into its own file when I was done editing, which seems tedious and error-prone, and I don't like tedious and error-prone. And since I can preview my XAML this way, isn't there some way to do it without the UserControl?

    Read the article

  • 5 Reasons why I hate WPF

    - by Richard Mitchell
    I decided to use writing a new tool as a way to learn WPF and MVVM and I thought I'd write down a few of my problems as a way of cathartic release. I decided to read a book before attempting WPF for the first time as I've heard others complain about the steep learning curve. I chose the rather excellent "WPF 4 Unleashed" by Adam Nathan to read through and "Pro WPF in C# 2010" by Matthew MacDonald as a reference whilst I programmed. 1 - Poor editing support for XAML The first thing I think any...(read more)

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >