private void btnStartKeyGen_Click(object sender, RoutedEventArgs e) { ViewModel.dlgKeyEditorViewModel vm = (ViewModel.dlgKeyEditorViewModel) this.DataContext; View.dlgPasswortGen dlgpwg = new dlgPasswortGen(this, vm.SelectedKey); dlgpwg.ShowDialog(); }
private void Button_Click(object sender, RoutedEventArgs e) { dlgSelectImage se = new dlgSelectImage(vmMain.GetAllIcons(), this); if ((bool)se.ShowDialog()) { ViewModel.dlgKeyEditorViewModel vm = (ViewModel.dlgKeyEditorViewModel) this.DataContext; vm.SelectedKey.ImageSource = se.SelectedImage; } se = null; GC.Collect(); }
public dlgKeyEditor(Model.KeyEntry key, Window owner) { InitializeComponent(); TempKey = key.Clone(); OriginalKey = key; vm = (ViewModel.dlgKeyEditorViewModel) this.DataContext; vm.SelectedKey = key; vm.SelectedKey.Zugriffsdatum = DateTime.Now; vmMain = (ViewModel.MainWindowViewModel)owner.DataContext; this.Owner = owner; //this.DataContext = key; ////this.txtPasswortPlain.DataContext = key.Passwort; this.cboGroups.ItemsSource = vmMain.DB.GetGroupList; this.cboGroups.SelectedItem = vmMain.SelectedGroup; }