wpf-binding

Binding to several Prperties

How do bind to more than one property in WPF? I know that you can use the ItemStringFormat="{0} my hard coded string" to describe a string value but I am interested in something like this ItemStringFormat="{0} ({1})" where item zero is a property and item one is a property in the bound class. public class ExchangeRate { public int I...

how to bind my view model properties to application settings?

My view model MyViewModel has a property MyProperty that i need to read/save from/to the application's settings. My project has Settings.settings file and the Settings type has MyProperty property. i need to bind MyViewModel.MyProperty to Settings.MyProperty so that any changes to MyViewModel.MyProperty are reflected in the Settings.MyPr...

MVVM Nested databinding

I'm having some trouble with databinding inside a UserControl when using an ItemsControl which has an ItemsSource. My Eventtrigger is never called. I Think the problem is that when I call my eventtrigger in the line: <cmd:EventToCommand Command="{Binding ElementName=layoutroot, Path=DataContext.Checked}" /> it tries to find the chec...

Why can't I bind to a field on a class in WPF instead of binding to a property

Possible Duplicate: Why does WPF support binding to properties of an object, but not fields? It appears that in WPF I cannot bind to a public field on an object, but only to public properties. Is this an intentional design decision on the part of WPF, or am I just getting the syntax wrong? Here's a sample snippet: public ...

WPF TabControl rebinding everytime

Hi, I am data templating a tab control. Each time I select a tab, the binding of the contents get applied. So for eg, if I have a tree view expanded in tab1 and going to tab2 and coming back has this collapsed. The property binded to ItemsSource is invoked each time I flip the tabs. learned its all because the visual tree gets recreate...

WPF ComboBox doesn't change the selected item

Hi people, I'm a newbie in WPF, so it probably is something very basic that I'm forgetting to do but I can't see what it is. I have a window with a combobox that display some data, I want the user to select a category in this combobox. It's working partially. The window show the combobox, starting with no selection, then the user choos...

multilevel tabcontrol - which collection we use to bindin mvvm

Hi, I have a wpf application which uses mvvm pattern. I need to have a collection in my view-model...which i can bind to multi level tab control. What type of collection I can use in this case ??? Is there any hierarchical collection in C# 3.5 ??? ...

Cannot pass commands with CommandBinding into app???

Hi, I am trying to create an app where I am going to have 3 menus in multiple pages. Each menu will have uniques menu items. I need to instantiate these menus to multiple pages since all 3 menus will be the same in all pages. I created 3 Lists for 3 sets of RoutedUICommands for each menu in the App level which should be accessible by any...

How to display a different value for dropdown list values/selected item in a WPF ComboBox?

I have a WPF combobox bound to a list of items with long descriptions. The type bound to the ComboBox has both short and long description as properties. Currently, I am binding to the full description. comboBox.DisplayMemberPath = "FullDescription"; How to ensure that when the item is selected and displayed as a single item in the co...

store procedures and button images in WPF, I'm new to this and lost at the same time

Hello, Please excuse my Question if it seams simple but i am lost and confused right now. i am new to WPF data binding. What i am tring to do is take a zip code from a textbox, than the program has a stored procedure to pull the data from. i have worked on this procedure for about 3 weeks now and have it giving me the results i need whe...

Multibinding converter???

I am tryng to write a multibinding converter for a navigation model where I load pages into a frame when any listboxitem is selected from two listboxes. At the same time, I need to be able to navigate with Back/Forward buttons from the navigation class and being able to show listboxitem in selected state if its UriSource is loaded into t...

WPF binding with stored procedure

I am trying to build a wpf application and having trouble with data binding. I would like to take numerical input from a text box, and would like to run a SQL query using a stored procedure on it to get 5 images display as buttons from a choice of 50 images, then display have the buttons view change to a text view based on which one of ...

WPF Binding TextBox Text Property to a specific ViewModel's Property in a TreeView

I have a TreeView which I have bound to a ViewModel called RootViewModel which has a collection of ViewModels ChildViewModel which has a collection of ViewModels GrandhChildViewModel. I have a text box next to the tree view. I want to bind the text box's text to a specific property of the selected item only when a GrandChildViewModel i...

WPF ObservableCollection Edit Mode

Hello, I am using observables collection all around my applications. My problem is that when i use a popup window for editing those entities, my bound lists are getting changed when the user changes those corresponding fields in the window. How could i simply freeze the observable changes norifications, and release them only when the e...

WPF binding isAsync Get State

I am using Binding IsAsync property to keep UI responsive and loading data from the get accessor of the property and proved to be a good option while using MVVM. This approach is great and doesn't need any manual code for async operations. There are few instances where my dataload is taking few seconds and during this time it is very dif...

MVVM. Is adding code to View justified in some cases?

I have a View which has a list of items bound to my ViewModel (MVVM pattern). Let's say it looks like that: <ScrollViewer Width="Auto" Height="Auto"> <ItemsControl ItemsSource="{Binding Path=MessageLog}" Grid.IsSharedSizeScope="True" ScrollViewer.CanContentScroll="True"> ...

ListView DataTemplate binding

I have the following ListView: <ListView Name="listView"> <ListView.View> <GridView> <GridView.ColumnHeaderContainerStyle> <Style TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Visibility" ...

wpf - binding datacontext to static properties of singleton class

I found myself using a lot of individual bindings to my App class for storage of properties and this led me to a untracable stackoverflow exception. I've now decided I would move those properties to a separate singleton ApplicationInfo class but I am having some issues with the binding. If I bind directly to a member property of my cla...

WPF Grouping a DataGrid nested in databound tabs

I need to apply grouping to rows in a DataGrid that is nested in a TabControl. Both the DataGrid and the TabControl are databound. The outermost control is bound to a ViewModel that exposes a collection of pages that is bound to the TabControl. Each page exposes a collection of lines that is bound to the Grid. I am tried to follow patt...

Static Binding to Singleton Mysteriously Fails

I have the following singleton class which contains the following property: public class Manager : INotifyPropertyChanged { public bool IsOnline ... public static Manager Instance ... } In the mark-up I am trying to change the color of a button based on this online property: <Button.Style> <Style TargetType="{x:Type...