Marshalling C++ struct in C#
We have a WPF project that needs to communicate with a C++ project via TCP/IP socket (Winsocket). WPF project requests data from C++ project and C++ project send its data from some C++ structs.
ComboBox Data Binding to an Enum in WPF
There is a little trick when a ComboBox binds to an Enum in WPF. Here we collect 3 ways.
Generic Type in WPF Custom Control is Limited by XAML
We tried to use Generic type in a WPF custom control, but later we realized WPF Xaml does not support generic type well, so either we use another non-generic class to wrap the custom control, or avoid using generic type in WPF custom control.
WPF GroupBox Header StringFormat Binding
When you try to use StringFormat binding for a GroupBox Header in WPF, you might find it does not work! Some people mentioned there is a HeaderStringFormat but not StringFormat, but at least in .NET 4.5, we can not find out a HeaderStringFormat.
WPF Advanced 01 WPF Architecture
We need to collect some advanced concepts or acknowledge about WPF. The first one is about WPF Architecture. The figures in this blog are drew by me, based on WPF articles from Microsoft.
What is the newest WPF version ?
Some WPF learners ask me what the newest WPF version is currently.
WPF Walks Slowly
WPF is such a great Microsoft software development technology. Its beautiful user interface implement and convenient object properties attached feature, was almost the final technology which was going to replace Windows Form technology;
WPF Microsoft is still Investing on It (2015 March)
2015 DontnetConf just passed, .NET developers got many existing news from .NET team and community. WPF is the one.
Silverlight Application Compile Failed in Visual Studio 2013 part 2
We had a post about “Silverlight application compile failed in Visual Studio 2013”, but this time after we did the steps which was introduced, we still got compile failed.
WPF and Windows Form Integration Application Localization
We have a Windows From application to load WPF modules, due to Microsoft programming guide, they called this kind of application as WPF and Windows Form integration application.
A Scada System Desktop Client
This is a client of a Scada system. It is a WPF windows application (built in 2014).
WPF Follow Parent’s Size 1
There are different ways to get child size follows parent’s size, here I collect 3 of them first:
A System Editor module in a Scada System using WPF part 2
This is the part 2 of the WPF applicatoin, the Part 1 is here:
A System Editor module in a Scada System using WPF Part1
Let's start to introduce the new System Editors module in a Coal Minding Scada system.
Conspec Windows Primary System S950 Part 1
Windows Primary System is a Coal Mine gas detection device control system which provided Conspec Controls.
Single WPF Application Instance
How we force to run only one instance of our WPF application ?
The Second Article was Chosen By Microsoft ASP.NET
Today I just read my emails and found that in the last day of 2013 My another blog article about new ASP.NET tech SignalR was accepted by Microsoft ASP.NET website and posted on the daily community article list.
Host SignalR 2.0 in WPF Application
Microsoft has released new versions of ASP.NET, Visual Studio, SignalR etc. The real-time web might be focused on their SignalR tech since SignalR supports Web Sockets and other compatible techs.
A Simulator Program Using WPF
This simulator program was for simulating a special company devices, which are for Coal Mine field gas detection.
Why As A Microsoft Tech Developer is So Painful!
When the years of Java Learn from C++, I did not have a good chance and a good reason to turn to Java, I think it was my BIG BIG Bad luck in my life. so, through so many years, I am keeping on the Microsoft technologies.
Microsoft Official WPF Samples
There are many WPF samples on the internet, but maybe you want Microsoft’s WPF samples.
WPF Animate An Object Along A Path
On MSDN there are several helpful article about how to animate an object along a path for WPF 4 (Unfortunately we tried some code, they do not work for Silverlight or part of them work):
Host ASP.NET Web API In WPF Application
WCF Web API is changed to ASP.NET Web API. ASP.NET Web API has the feature of self-host. In Microsoft official site, they have provided two simples ASP.NET Web API self-host samples. However, they are too simple and actually they looks like the “same” one because those 2 samples are Console applications and they use very similar content.
Is Microsoft still making new version for WPF and Silverlight ?
IT world is changing fast. There are always new tech everyday. Especially after HTML5 came, looks like lots of existing tech have been affected what ever how they were great. such as Flash, Silverlight…
WPF Chart Control in Visual Studio 2010
When you use Visual Studio 2010, you will find there is no a WPF chart control in toolbox. The WPF chart control does not followed with .NET 4.0 release, It is still in .NET 3.5 WPFtoolkit. You might have to download the WPF toolkit and install it. But please check before you download and install, because the toolkit might have already been installed with the Visual Studio 2010 installation or other stuff installations. You can try to start the following steps, if you can not find chart, you then download and install WPF toolkit.
WPF Binding to local variable
Find Child Control in WPF
How to wrap text in a Button in WPF?
You have multiple ways to wrap text in a button. Here some sample code:
How to programmatically click a button in WPF
Actually, there is no big different if you want to programmatically click a button in either WPF or Windows Form. They might have slightly different approach.
WPF Data Binding Using Code Behind and XAML
You can use either of code behind or XAML to implement data binding in WPF:
WPF The calling thread must be STA
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:
App.config in WPF Project
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.
Mouse Hover Event in WPF
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.
About WPF Multithreads
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.
WPF DependencyProperties vs INotifyPropertyChanged
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:
Resizing a WPF Window using Thumb
Thumb control is a very helpful control which can help we drag a control.
WPF / Siverlight Routed Events Processing Order
Here is the order of WPF / Silverlight event processing :
WPF LayoutTransform and RenderTransform
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.
Default coordinate system and customer coordinate system in WPF
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:
Handle all buttons click event in a single method in WPF
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.
WPF's four measure units in coordinates
WPF provides four different units of measures:
WPF classic features
WPF classic features:
WPF Shapes vs. WPF Geometries
Each of the Shape derived classes (Rectangle, Ellipse, Ploygon, etc) are very useful when you need to incorporate user interactivity in your graphics, as shapes extend UIElement. As you might know, this base class defines numerous mouse-centric events.
WPF and UserInteractivity
Here are Bechir Bejaoui's articles about WPF and UserInteractivity
WPF Save Canvas to XAML and Load from XAML
1: Save Canvas to XAML:
Differences between WPF and Silverlight
Here are some links about differences between WPF and Silverlight:
A great WPF custom control for zooming and panning
Ashley Davis has build a great WPF custom control for zooming and panning. His sample code and control source code has published on CodeProject.com.
Map APIs for Silverlight and WPF
There are several Map API for Silverlight and WPF:
WPF or Windows Forms ?
_Windows Presentation Foundation (WPF) is a next-generation presentation system for building Windows client applications with visually stunning user experiences. WPF supports UI, media, documents, hardware acceleration, vector graphics, scalability to different form factors, integration with Windows, interactive data visualization, and superior content readability. Read all about recent updated and additions to WPF here.