Our basic framework has been set up, now the integration of MVVM framework prism, in ViewModel do some logical processing, the interface design really separate.
This facilitates our system development and division of service, while improving system maintainability and flexibility.
Specific Prism installation and Microsoft.Practices.Prism.dll access in this URL: http://compositewpf.codeplex.com/
The same primitive pattern as WinForm:
(1) Now look at the previous design of the View:MainWindow.XAML source code:
(2) MainWindow.xaml.cs Source:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.Windows;
Using System.Windows.Controls;
Using System.Windows.Data;
Using System.Windows.Documents;
Using System.Windows.Input;
Using System.Windows.Media;
Using System.Windows.Media.Imaging;
Using System.Windows.Navigation;
Using System.Windows.Shapes;
Using Fluent;
Using Xceed.Wpf.AvalonDock.Layout; namespace TLAgent.SecurityManager.WPF {///<summary>///interaction logic for MainWindow.xaml///< /summary> public partial class Mainwindow:ribbonwindow {public MainWindow () {in
Itializecomponent (); } private void Onexitsystem (object sender, RoutedEventArgs e) {messageboxresult result = Mess
Agebox.show ("Are you sure you want to exit the system?", "confirmation message", Messageboxbutton.okcancel, messageboximage.question);
if (result = = Messageboxresult.ok) {Application.Current.Shutdown (); }
}
}
}