Search Results

Search found 9012 results on 361 pages for 'wpf binding'.

Page 13/361 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • WPF ComboBox Object Binding - not updating DataContext Object

    - by Jaysen
    Hello, I have the following scenario: 1 class called 'Widget' with the properties: ID, Code, Description 1 class called 'MyWidget' with a property: m_Widget As Widget 1 ComboBox The ComboBox has a List(Of Widget) set as the ItemSource. I create an instance of 'MyWidget' named MyWidget1 and I set the property values of the m_Widget to match one of the items in the 'ComboBox List(Of Widget)'. I then set the DataContext of the ComboBox to MyWidget1.Widget. When I change the ComboBox selected item, only the ID property of 'MyWidget1.Widget' gets updated... How do I get the object 'Widget' on 'MyWidget1' to be updated instead of just 'MyWidget1.Widget.ID'? Here is a link to a sample project demonstrating this scenario: http://www.webpersona.com/ObjectBinding.zip Thanks in advance for any help :)

    Read the article

  • Wpf ListViewItem Background binding to enum

    - by Christian
    Hi Guys I´ve got a ListView which is bound to the ObservableCollection mPersonList. The Class Person got an enum Sex. What i want to do is to set the background of the ListViewItem to green if the person is male and to red if the person is female. Thanks for the answers!

    Read the article

  • WPF Binding Question - Change Label Text based on Modifier Key Control

    - by Chuck Savage
    I have a context menu, that I'd like to change the Header based on whether the Control Key is pressed or not. Right now I have, <MenuItem Header="Send To"> <MenuItem ... /> <MenuItem ... /> </MenuItem> I'd like based on the Control Key being down to be, <MenuItem Header="Move To"> <MenuItem ... /> <MenuItem ... /> </MenuItem> All I really need to do is change the Header text, because inside the code I know how to check for the Modifier key being Control.

    Read the article

  • problem binding ListBox on ObservableCollection<T>

    - by Fabian
    Hello, I have a strange "problem". Could someone explain me why : If I have in an ObservableCollection, twice (or more time) an item with the same value, then the selections of those values in the ListBox won't work properly ? In fact, what the ListBox is doing when I click on an item(Even in single item selection) : It selects the first item from the ObservableCollection collection with a matching value. so in the case if multiple items with same value are in the collection, then only the first one will be selected !

    Read the article

  • WPF Binding Between Controls

    - by David Ward
    I have a control on a page that contains a listbox. I also have another control which is a detail view. Both of the controls have their own ViewModel which their child controls bind to. Image Outlook. It has a list of folders and when you select a folder the detail control displays the contents of the folder. How can I bind the detail control to the selected item in the list control?

    Read the article

  • Binding dont refresh, even when explicitly calling UpdateTarget

    - by Erik
    My ListView does not refresh its bindings when i call OnPropertyChanged. I have tried to force it to refresh by: NestedArguments.GetBindingExpression(ItemsControl.ItemsSourceProperty).UpdateTarget(); But still, no luck! YES, it does get updated. I have set a breakpoint and checked. What is going on? Other bindings seem to work without a problem

    Read the article

  • Binding FontStyles and FontWeights to WPF ComboBox

    - by Haemoglobin
    I was just wondering if it would be possible to bind the list of available FontStyles and FontWeights to a ComboBox? For example, to bind the list of fonts to a combobox you can use: FontComboBox.ItemsSource = Fonts.SystemFontFamilies; Can I also have something for : FontStyleComboBox.ItemsSource = .... FontWeightComboBox.ItemsSource = .... ? Would it require reflection on the System.Windows.FontWeights and System.Windows.FontStyles classes or would there be an easier way than that? Thanks

    Read the article

  • C#/WPF - RoutedEvent in WPF class that isn't a UIElement

    - by Andreas
    I have a class that needs to notify that something significant has occured. The class is in a WPF-project, even though this specific class, is lookless (and doesn't inherit from UIElement, neither directly or indirectly). Normally, I just register a RoutedEvent to get this functionality but as this class neither has AddHandler nor RemoveHandler, I can't get it to work. Anyone knows of another way of get the RoutedEvent behaviour?

    Read the article

  • WPF DataGrid and Avalon TimePicker binding problem

    - by Jorge Vargas
    I'm using a the WPF DataGrid from the wpf toolkit and a TimePicker from AvalonControlsLibrary to insert a collection of TimeSpans. My problem is that bindings are not working inside the DataGrid, and I have no clue of why this isn't working. Here is my setup: I have the following XAML: <Window x:Class="Views.TestMainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpf="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:a="http://schemas.AvalonControls/AvalonControlsLibrary/Controls" SizeToContent="WidthAndHeight" MinHeight="250" MinWidth="300"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <GroupBox Grid.Row="0"> <GroupBox.Header> Testing it: </GroupBox.Header> <wpf:DataGrid ItemsSource="{Binding Path=TestSpans}" AutoGenerateColumns="False"> <wpf:DataGrid.Columns> <wpf:DataGridTemplateColumn Header="Start"> <wpf:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <a:TimePicker SelectedTime="{Binding Path=., Mode=TwoWay}" /> </DataTemplate> </wpf:DataGridTemplateColumn.CellEditingTemplate> <wpf:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding}" /> </DataTemplate> </wpf:DataGridTemplateColumn.CellTemplate> </wpf:DataGridTemplateColumn> </wpf:DataGrid.Columns> </wpf:DataGrid> </GroupBox> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1"> <a:TimePicker SelectedTime="{Binding Path=SelectedTime, Mode=TwoWay}" /> </StackPanel> </Grid> And this is my ViewModel: Imports System.Collections.ObjectModel Namespace ViewModels Public Class TestMainWindowViewModel Private _selectedTime As TimeSpan = DateTime.Now.TimeOfDay Public Property SelectedTime() As TimeSpan Get Return _selectedTime End Get Set(ByVal value As TimeSpan) _selectedTime = value End Set End Property Private _testSpans As ObservableCollection(Of TimeSpan) = New ObservableCollection(Of TimeSpan) Public Property TestSpans() As ObservableCollection(Of TimeSpan) Get Return _testSpans End Get Set(ByVal value As ObservableCollection(Of TimeSpan)) _testSpans = value End Set End Property Public Sub New() _testSpans.Add(DateTime.Now.TimeOfDay) _testSpans.Add(DateTime.Now.TimeOfDay) _testSpans.Add(DateTime.Now.TimeOfDay) End Sub End Class End Namespace I'm starting this window in application.xaml.vb like this: Class Application ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException ' can be handled in this file. Protected Overrides Sub OnStartup(ByVal e As System.Windows.StartupEventArgs) MyBase.OnStartup(e) Dim window As Views.TestMainWindow = New Views.TestMainWindow window.DataContext = New TestMainWindowViewModel() window.Show() End Sub End Class

    Read the article

  • Query on MVVM pattern in WPF?

    - by Ashish Ashu
    I am implementing a MVVM pattern in my WPF application. My application main window is divided into four parts: Main Menu On the Top Outlook Navigation Control on the Left. A List View on the Middle. Another List view on the bottom. The Navigation control shows different setting (configuration) controls in the Tab items. All the four above are user controls which are placed in the main window. And corresponding to each user control there is separate view model which is bounded with a view model in the XAML of each control, however the model class remain the same between all the view model. And a MainWindow has a seperate View Model which is also bounded with a view model in the XAML of each control. Please help me out in framing a design in which each view models of all the controls above will interact with each other. Please let me know if my question is not clear to you!!

    Read the article

  • WPF 3D - converting from Point2D to Point3D and back again

    - by DanM
    I'm new to WPF 3D, so I may just be missing something obvious, but how would I go about converting from a 2D coordinate to a 3D coordinate and back again? I'd like the 2D coordinate to be the location measured from the upper-left corner of Viewport3D and the 3D coordinate to be the location relative to the origin (0, 0, 0) of the 3D world. The conversion functions should have these signatures: public Point3D Point2DAndWorldZToPoint3D(Point2D point2D, double worldZ) // usually I want to know where a 2D point will be on the ground plane // so worldZ will usually be zero (but not always) public Point2D Point3DToPoint2D(Point3D point3D) I found this related question, but it only addresses conversion from 3D to 2D (not the reverse), and I'm not sure if the answers are up-to-date. Note, I'm currently using .NET 3.5, but if there are improvements in .NET 4.0 that would help me, please let me know.

    Read the article

  • WPF Window Style not working at runtime

    - by Christian Pena
    Hi, I created a WPF application in Visual Studio 2010 Express (C#) and added the text below to the Application.Resources in App.xaml. I see the style applied to the window in the designer, but when I run the application, the window background is white. Running in Windows XP on BootCamp on a MacBook Pro if that is a factor. Thanks in advance, Christian <Style TargetType="{x:Type Window}"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Offset="0" Color="WhiteSmoke" /> <GradientStop Offset="1" Color="Silver" /> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="Padding" Value="20" /> </Style>

    Read the article

  • EventTrigger RoutedEvent in wpf xaml

    - by Cinaird
    I have a problem in wpf xaml and i'm pretty new on this so it may be something basic i want to rotate a ellipse 360 degree <Ellipse Name="test" Fill="Black" StrokeThickness="5" Margin="0,0,0,0" Height="66"> <Ellipse.Triggers> <EventTrigger RoutedEvent="Ellipse.Loaded" SourceName="test"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="test" Storyboard.TargetProperty="(Ellipse.RenderTransform).(RotateTransform.Angle)" From="0" To="360" Duration="0:0:0.5" RepeatBehavior="1x" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Ellipse.Triggers> </Ellipse> But nothing happens, what is wrong?

    Read the article

  • WPF 3D - Need help writing conversion methods between 2D and 3D (Point3DToPoint and PointAndZToPoint

    - by DanM
    I'm new to WPF 3D, so I may just be missing something obvious, but how do I convert from 3D to 2D and (for a given z location) from 2D to 3D? Specifically, I need two conversion methods: Point3DToPoint - If I have an (x, y, z) coordinate in the 3D world, how do I determine the (x, y) coordinate on the projected 2D surface. Method signature: public Point Point3DToPoint(Point3D point3D) PointAndZToPoint3D - If I have an (x, y) coordinate on the projected 2D surface and a z location in the 3D world, how do I determine the intersecting (x, y, z) coordinate in the 3D world? Method signature: public Point3D PointAndZToPoint3D(Point point, double z) I'd like the 2D coordinate to be the location measured from the upper-left corner of Viewport3D and the 3D coordinate to be the location relative to the origin (0, 0, 0) of the 3D world. Note 1: I found this related question, but it only addresses conversion from 3D to 2D (not the reverse), and I'm not sure if the answers are up-to-date. Note 2: I'm currently using .NET 3.5, but if there are improvements in .NET 4.0 that would help me, please let me know.

    Read the article

  • multy threading wpf

    - by Eran
    Hey, I'm using web refernce call in new working thread in my application as follow: Thread callRunner = new Thread(delegate() { _mediator.IncomingCallDetails(phoneNumber); }); callRunner.Start() ; the _mediator calls the web refernce and replay to the caller in event as follow: void IncomingCallComplited(IncomingCallEventArg args) { Caller = args.Caller; Lodgers = args.Lodgers; PreviousMissions = args.PreviousMissions; } Caller ,Lodgers and PreviousMissions are properties of an object that bind to GUI element,as for now the binding works fine and i can see the values from the web refernce in screen my question is should I use Dispatcher in the event or in any other phase ? and if I do can someone please explain why? Thanks Eran

    Read the article

  • multi threading wpf

    - by Eran
    Hey, I'm using web refernce call in new working thread in my application as follow: Thread callRunner = new Thread(delegate() { _mediator.IncomingCallDetails(phoneNumber); }); callRunner.Start() ; the _mediator calls the web refernce and replay to the caller in event as follow: void IncomingCallComplited(IncomingCallEventArg args) { Caller = args.Caller; Lodgers = args.Lodgers; PreviousMissions = args.PreviousMissions; } Caller ,Lodgers and PreviousMissions are properties of an object that bind to GUI element,as for now the binding works fine and I can see the values from the web reference in screen my question is should I use Dispatcher in the event or in any other phase ? and if I do can someone please explain why? Thanks Eran

    Read the article

  • wpf toolkit (Feb 2010) datagrid with MVVM - style reveals name of view model on 'spare column'

    - by Andy Clarke
    Hi, I've just updated my app with the latest WPF toolkit and I've now got an issue with my styling. When I bind some data with, for example, two columns to the grid, the spare area at the right shows the name of the ViewModel in the header. I can understand why, because the data grids data context is the ViewModel and I'm defining my header style as follows ... <WpfToolkit:DataGridHeaderBorder <Border BorderBrush="Blue" BorderThickness="0,1,0,0"> <TextBlock Text="{Binding}" Margin="4,0,4,0" /> </Border> </WpfToolkit:DataGridHeaderBorder> Do I now need a separate style for the 'spare column' or something? Can anyone assist please? Cheers, Andy

    Read the article

  • How to Animate a Gradient on a Path to visualize data flow in WPF/WCF app

    - by John
    I have an interesting project where several "nodes" on a cnavas are connected via a Path similiar to a mindmap tree. The path is used to visualize the connection state between two nodes. Red means the nodes are disconnected, green means they're connected. The next step would be to illustrate data flow (from A to B or B to A) using that path and an animation. Basically I would want to start the animation with the data transfer and stop it when the transfer is complete. Does anyone know how this could be done in WPF?

    Read the article

  • WPF MenuItem ViewModel Command

    - by Jon Archway
    Hi, I am fairly new to WPF and am struggling a little with a scenario. I have a menu which has menu items. When one of these menu items gets clicked a method needs to be called that will do something based upon the text displayed associated with that menu item. So for example, the menu item's content was "test" so I would need to do something with "test". FYI, this "something" directly affects a collection on the ViewModel. This is easy to achieve using the click event and no ViewModel, but I was trying to implement MVVM using an explicit ViewModel. So I started to look into Commands but cannot see how I would pass anything from the View back into the Command in the ViewModel. Any suggestions on what I should be doing here? Thanks

    Read the article

  • WPF - Have a list source defined at runtime but still have sample data for design time

    - by Vaccano
    I have some ListBoxes in my WPF app. I would like to be able to view how the design looks with out having to run the app. But I still want to be able to bind to ItemsSource to my View Model. I know I saw a blog post on how to do this, but I cannot seem to find it now. To reiterate, I want dummy data at design time, but real data at run time and not break the MVVM pattern. Any ideas?

    Read the article

  • Navigate between screens in WPF

    - by Greg R
    This should be a very basic design question, but for some reason it doesn't seem to be well documented (maybe due to its simplicity?). If I'm building a dashboard application in WPF that brig up different CRM tasks and I want to navigate between screens, is this the best way to do this, or is there a better way? So for example I have Log In Screen - Main Menu Screen - Screen to one of different utilities var orderManagerWindow = new MyXamlView(); var loginWindow = Application.Current.MainWindow; orderManagerWindow.Left = loginWindow.Left; orderManagerWindow.Top = loginWindow.Top; Application.Current.MainWindow = orderManagerWindow; orderManagerWindow.Show(); loginWindow.Close(); I would really appreciate help and suggestions!

    Read the article

  • Setting the background color of WPF TabControl inactive tabs

    - by David Veeneman
    Is there a simple way to set the background brush of all inactive tabs in a WPF TabControl? I want to emulate the look of VS 2010 on a TabControl--the background color of the control's inactive tabs should match the background color of the window in which the TabControl is sited, so that you see only the text of the tab, and not the tab itself. I know it will take a ControlTemplate to do it; I am trying to figure out what to put in the control template. Put another way, How do I specify that a particular brush should be applied to all inactive tabs? Thanks for your help.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >