Esempio n. 1
0
        /// <summary>
        /// The on startup.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnStartup( StartupEventArgs e )
        {
            try
            {
                base.OnStartup( e );

                var data = new TestData
                               {
                                   Name = "Test", 
                                   Id = 123
                               };

                var window = new MainWindow
                {
                    DataContext = new TestVM( data )
                };

                window.ShowDialog();

            }
            catch( Exception exception )
            {
                MessageBox.Show( exception.Message );
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestVM"/> class.
 /// </summary>
 /// <param name="model">
 /// The model.
 /// </param>
 public TestVM( TestData model )
     : this()
 {
     this.model = model;
 }