Exemplo n.º 1
0
        /// <summary>
        /// If user clicked No-Button
        /// </summary>
        /// <param name="sender">the button</param>
        /// <param name="e">the routed event arguments</param>
        private void DontApply_Click(object sender, RoutedEventArgs e)
        {
            // Get ViewModel from DataContext
            XmlStylesheetDialogViewModel vm = (XmlStylesheetDialogViewModel)DataContext;

            // Iterate over XmlStylesheets in ViewModel, deselecting all stylesheets
            foreach (XmlStylesheet xs in vm.XmlStylesheets)
            {
                xs.IsSelected = false;
            }
            RaiseDialogConfirmedEvent();
            metroWindow.HideMetroDialogAsync(this);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Contructor injecting data context
 /// </summary>
 /// <param name="vm"></param>
 public XmlStylesheetDialog(XmlStylesheetDialogViewModel vm)
 {
     InitializeComponent();
     DataContext = vm;
 }