Instant Chat in WPF part 1

Taskbar/Context menu in WPF application
In the App.xaml.cs, the application starts in the OnStartUp () event, this I used to start an Custom Component with a NotifyIcon and ContextMenu. The NotifyIcon component provides the functionality for compatibility with the taskbar and the context menu, for which you can imagine the functionality. Below you see the instantiation in the App.xaml.cs;  

After this a instance is created in the NotifyIconWrapper Class for the MainWindow:
private readonly MainWindow win = new MainWindow();

The click events of the contextmenu are responsible for opening the different (WPF) screens, the call at the event for the configuration screen is called in the constructor so this one opens first.
By registering the Controller  belonging to the Configuration.xaml directly in the xaml, it's possible to bind directly against the properties. As shown in the next xaml code fragment.


The Controls in the screen are bound in their Text and Tooltip property with a simple declaration like this: Text="{Binding Path=MainUser.DefaultPort, Mode=TwoWay}"
TwoWay means that any changes from the backend are processed in the GUI and vice versa.

The MainUser is known in all Controllers, and declared in the MainController which is used by all the Controls as an base class. Because the setter has a PropertyChanged Event changes are passed to all Controls that have a subscription on them via the property binding.


<Previous>                                                                                                                                       <Next>

-December 2018+
  • RSS
  • Add To My MSN
  • Add To Windows Live
  • Add To My Yahoo
  • Add To Google


  • Entries (1)
  • Comments (0)


Leave your comments here 

Monday, May 16, 2011 7:49:00 PM

Just click on 'Reacties()' to give a comment

Site Map | Printable View | © 2010 - 2018 LeBroITSolutions | HTML 5 | CSS