In a multithread WPF project, we got program crash, but actually WPF did not give us any help or error information on the screen, then we tried to debug using steps,  finally we got the following error information on a line of code with adding related variable in this line of code into Watch window: [Read More ...]

When you try to use ConfigurationManager in your WPF project, you might can not get it work because there is no related reference by default in WPF project. You have to add the reference manually, check MSDN here, we know we have to add the reference to System.Configuration.dll file. After above step, you can add [Read More ...]

There is no mouse hover event in WPF, The MouseHover function has been split into two parts: MouseEnter and MouseLeave. So we can use them if we need mouse Hover function. private void UserControl_MouseEnter(object sender, MouseEventArgs e) { … } private void UserControl_MouseLeave(object sender, MouseEventArgs e) { … }

This is a learning notes. We are not going to tell more knowledge about WPF multiple threads, we just give some samples which we practiced. There are different solutions to implement multiple threads in WPF: 1: The Task: We firstly introduce the task is because it is recommended in .NET 4, it is a newer [Read More ...]

1: Windows Presentation Foundation Data Binding: Part 1 2: Windows Presentation Foundation Data Binding: Part 2 3: WPF : Binding to individual collection items (but not in a ItemsControl) 4: How to: Create a Binding in Code 5: Change Shape’s location due to variable on Canvas (Chinese) 6: IValueConverter Interface 7: IValueConverter in WPF data [Read More ...]

There are 2 ways to get the automatic notice target object if the source object changed (for example: the value) when you using WPF data binding: the one is Dependency Properties, the other one is INotifyPropertyChanged: InotifyPropertyChanged  sample: public class IODataPresentation : INotifyPropertyChanged {     public event PropertyChangedEventHandler PropertyChanged;     private string _ValueString;     public [Read More ...]

Here is the order of WPF /  Silverlight event processing :    1.      PreviewMouseDown (tunnel) on root element.   2.      PreviewMouseDown (tunnel) on intermediate element #1.   3.      PreviewMouseDown (tunnel) on source element #2.   4.      MouseDown (bubble) on source element #2.   5.      MouseDown (bubble) on intermediate element #1.   6.      MouseDown (bubble) on root element. Above content [Read More ...]

LayoutTransform – A transform that is applied before the layout pass. After the transform is applied, the layout system processes the transformed size and position of the element. RenderTransform – A transform that modifies the appearance of the element but is applied after the layout pass is completed. By using the RenderTransform property instead of [Read More ...]

For 2D graphics, the WPF coordinate system locates the origin in the upper-left corner of the rendering area. In the 2D space, the positive X-axis points to the right, and the positive Y-axis points to downward, as shown below: Now we will create our own coordinate system, we want to move the origin from the [Read More ...]

Now we have a stack, we put multiple buttons into this stack, all these buttons will for similar popup windows when they are clicked, so want to handle all these buttons in a single method. You might have multiple solution to write the single method, here we have a good sample: xmal file: <Window     [Read More ...]

© 2013 CodeEase.com Suffusion theme by Sayontan Sinha