wpf

Copy one object to another

Hi All, I have 2 tables, user and userprofile. The userprofile table has a lot of fields similar to the user table. What I need to do is, on click of a button I need to copy all the fields of user table to userprofile table. How can I do that? ...

"Authentication Failure" when calling a method on Remote Object in wpf

I am developing an application which uses WindowsFormsApplicationBase to enforce Single Instance. I get the following error when calling a method on a Remote object. It works fine if I don't use Single Instance approach. System.Runtime.Remoting.RemotingException: Authentication failure ---> System.IO.IOException: Unable to read data fro...

[WPF] When Should I Retrieve Values from Textbox?

Suppose I have a Window with TextBoxes I want to use the values. Right now I'm thinking of either: 1) Updating each associated value once the cursor is out of focus, and once the user presses Ok I start the program 2) Once the user presses Ok, I retrieve all the values at once then start the program I'm not sure which one is better tho...

WPF Combobox binding

I got two Comboboxes and both of them have binding with the same Source. <ComboBox ItemsSource="{Binding Source={StaticResource UsersViewSource}}" And when I change something in the first one, it reflects also to the second one. And I dunno how to keep their SelectedItem values separately, using the same ItemsSource. ...

WPF Auto height in code

How could I set the value of the Height property of a WPF control in C# code to "Auto"? <Grid.RowDefinitions> <RowDefinition /> <RowDefinition Height="Auto" /> <RowDefinition /> <RowDefinition Height="Auto" /> <RowDefinition...

Recommendations on developing a WPF application without using MVVM or similar

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 o...

Loading and binding a serialized view model to a WPF window?

Hello all. I'm writing a one-window UI for a simple ETL tool. The UI consists of the window, the code behind for the window, a view model for the window, and the business logic. I wanted to provide functionality to the users to save the state of the UI because the content of about 10-12 text boxes will be reused between sessions, but ...

How to parametrize WPF Style?

Hi! I'm looking for a simplest way to remove duplication in my WPF code. Code below is a simple traffic light with 3 lights - Red, Amber, Green. It is bound to a ViewModel that has one enum property State taking one of those 3 values. Code declaring 3 ellipses is very duplicative. Now I want to add animation so that each light fades i...

Treeview Getting parentNode xaml wpf

Hi all, I have a treeview in wpf and I load it ok is all done in zaml . I have a problem and this is mainly because I am new to zaml. If i have this structure England London Manchester Liverpool etc... and I select london i need to display "England-London" . I dont seem to get how to retrieve the parent o...

Difference between Popup's IsOpen and Visibility properties?

I've played around with the WPF Popup Control and as far as I can see, the Visibility property is superfluous. If you have a Popup with IsOpen = True, it will be visible even if its Visibility = Collapsed. If you have a Popup with IsOpen = False, then its Visibility will be Collapsed, and will remain "Collapsed" when IsOpen changes to ...

WPF User Control loading twice

Hai am having a WPF user control, when i use that control in another window it loading twice, so its throwing exception for me, coz am having some function in usercontrol_loaded event, when it loading twice it throwing error, is there any other way to check if the usercontrol is loaded like that, else how to solve this issue. ...

How to interpret GestureRecognizer results sort order?

The documentation for the GestureRecognizer class in .NET states that the sort order of the results returned by the Recognize method has to do with how strong the confidence is. However, when I created my own sample (in WPF, .NET 3.5sp1) that creates a recognizer I do not see this behavior. For the record, i set the recognizer to recogn...

WPF DataGrid: How to reset column width when applying new ItemsSource

I am using a DataGrid to display details of an item selected in a ListBox. The DataGrid has 3 columns set to Width="Auto". As different items in the ListBox are selected, the width of the columns in the DataGrid increase as needed in order to display the text. What I want is that the column widths also decrease when the extra width is ...

Where to find Success WPF UI Desing ?

I'm looking for some WPF UI design sample to implement my own WPF UI. As I know this is not a programming related question, I'd mark this question as Community Wiki, and I ask this because I know how important is a wiki to list success design, So please do not close this question. Any Design and sample appriciated ...

DataTrigger only works on first TabItem in TabControl

Hi! It seems like a bug in WPF, but maybe someone has an answers to this. I have a DataTrigger for an editable ComboBox. It works on the first TabItem of my TabControl, but not on the second. If you switch the first with the second TabItem, the "second" will work. The same effect happens when you give the style exactly to the ComboBox (C...

WPF: Binding Combobox in Code Behind to Property

Hi All, This might be something very straight forward and I really think it should work as is, but it doesn't... I have the following scenario: var itemSource = new Binding { Path = new PropertyPath("ItemList"), Mode = BindingMode.OneTime }; comboBox.SetBinding(ItemsControl.ItemsSourceProperty, itemSource); ItemList ...

Progress bar hanging in wpf?

Hi, In WPF application, a progress bar is shown at the corner of the window. I want this to always run. So i have made IsIndeterminate property to true. Some prompts will come while running the application, there progress bar also hangs as UI thread hangs. But i want this progress bar to run.I have already tried with background thread a...

WPF image zooming

WPF: What is the best way to implement Zoom In and Zoom Out option for an Image inside ScrollViewer in WPF at runtime and also other alternative methods for the same Please provide sample code and suggest links where I can find sample code and more info about various ways to Zoom the image. Regards, Anwar ...

WPF Changing the user interface language at runtime

Hi I want to change my user interface language at run time. what is the best approach to do this? Regards Raju ...

wpf treeview sub items padding

in typical treeview appearence is like below +Root --item 1 --item 2 i want to have following appearence +root -item1 -item2 i want to remove extra padding... how can i... ...