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

Sample 1:

WPF links

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:

WPF PriorityBinding

The sample is from MSDN

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.

Links about WPF

1: Windows Presentation Foundation Data Binding: Part 1

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:

WPF and Bing Map

1: Interactive Mapping Control for WPF

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:

Silverlight, WPF, AutoCAD, Zoom

1: Displaying AutoCAD drawings using xamWebMap

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.

asp.net (146) c# (101) .net (92) silverlight (62) sql server (59) visual studio (57) wpf (53) Web (53) Windows (51) sql (42) microsoft (39) cloud (37) wcf (35) mvc (27) windows forms (22) azure (19) computer (19) c++ (16) iis (16) source control (16) javascript (15) c (15) WordPress (13) mobile (13) database (13) map (13) git (12) report (12) Blog (10) gis (10) linux (10) php (9) svn (9) css (7) google (7) system (7) jquery (7) web api (6) windows phone (6) open source (5) gmail (5) html (5) java (5) bing map (5) membership (4) windows server (4) system management (4) html5 (4) amazon (4) vmware (4) control (4) Virtual Machine (4) storage (3) binding (3) api (3) security (3) virus (3) cpu (3) network (3) modbus (3) windows 7 (3) signalr (3) linq (3) chart (3) bing (3) eclipse (3) job (3) iot (3) youtube (3) mono (3) news (3) blazor (2) .net core (2) socket (2) bootstrap (2) data (2) development (2) setup (2) Skype (2) driver (2) xml (2) vb.net (2) cellphone (2) uml (2) VB (2) Router (2) server (2) programming (2) game (2) xbox (2) phone (2) visio (2) ado.net (2) ssd (2) angularjs (2) animation (2) video (2) interview (2) tools (2) permission (2) xamarin (2) cross platform (2) tcp (1) client (1) WebAssembly (1) Website (1) Static (1) screen (1) tablet (1) ai (1) enum (1) esri (1) document (1) help (1) android (1) iphone (1) it (1) threat (1) software (1) kinect (1) size (1) install (1) print (1) grant (1) power (1) page (1) web app (1) printer (1) monitor (1) jave (1) wp7 (1) apps (1) office (1) dell (1) font (1) windows.form (1) vista (1) xp (1) ce (1) compact (1) object (1) hosting (1) Micorosoft (1) sdk (1) hot key (1) rss (1) combobox (1) gps (1) mobille (1) chrome (1) firefox (1) ie (1) embedded (1) media-player (1) firewall (1) GAC (1) browser (1) Memory (1) mfc (1) memebership (1) image (1) WiFi (1) Powerline (1) Internet (1) postgresql (1) Scada (1) email (1) singleton (1) life (1) Code (1) web socket (1) iis express (1) entity framework (1) windows-8 (1) event (1) Cell phone (1) design (1) thread (1) mysql (1) editor (1) sql.server (1) msdn (1) shared (1) reset (1) share (1) restful (1) deals (1) deal (1) angular (1) free shipping (1) ajax (1) iquery (1) core (1) tfs (1) config (1) password (1) 3d (1) maya (1) mel (1) rendering (1) agile (1) software development (1) hyper-v (1) linkedin (1) social (1) HDD (1) tekton (1) account (1) schduler (1) architecture (1) solution (1) seo (1) home (1)