Ejemplo n.º 1
0
        /// <summary>
        /// Validates the specified s.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <param name="args">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private static ProductDetails Validate(object s, RoutedEventArgs args)
        {
            ManipulatorViewModel viewModel = new ManipulatorViewModel(new ProductDetails(), false);
            ManipulatorView      addView   = new ManipulatorView(viewModel);

            addView.Owner = Application.Current.MainWindow;

            if ((bool)addView.ShowDialog())
            {
                return(viewModel.ProductInfo);
            }
            return(null);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManipulatorView"/> class.
 /// </summary>
 /// <param name="viewModel">The view model.</param>
 public ManipulatorView(ManipulatorViewModel viewModel)
 {
     InitializeComponent();
     this.DataContext = viewModel;
 }