Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            vm          = new ViewModel.MainWindowViewModel(this);
            DataContext = vm;
        }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();

            Closed += MainWindow_Closed;

            DataContext = new ViewModel.MainWindowViewModel();
        }
Esempio n. 3
0
 public UdpSocketClient(ViewModel.MainWindowViewModel _ViewModel)
 {
     this.ViewModel         = _ViewModel;
     this.AsyncNetUdpClient = new AsyncNetUdpClient(_ViewModel.Address, _ViewModel.Port);
     this.AsyncNetUdpClient.ClientExceptionOccured += this.AsyncNetUdpClient_ClientExceptionOccured;
     this.AsyncNetUdpClient.ClientReady            += this.AsyncNetUdpClient_ClientReady;
     this.AsyncNetUdpClient.ClientStarted          += this.AsyncNetUdpClient_ClientStarted;
     this.AsyncNetUdpClient.ClientStopped          += this.AsyncNetUdpClient_ClientStopped;
     this.AsyncNetUdpClient.UdpSendErrorOccured    += this.AsyncNetUdpClient_UdpSendErrorOccured;
     this.AsyncNetUdpClient.UdpPacketArrived       += this.AsyncNetUdpClient_UdpPacketArrived;
     this.AsyncNetUdpClient.StartAsync();
 }
Esempio n. 4
0
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var dataContext = ((FrameworkElement)e.OriginalSource).DataContext;

            if (dataContext != null)
            {
                if (e.AddedItems.Count > 0)
                {
                    Window parentWindow = Window.GetWindow(this);
                    ViewModel.MainWindowViewModel mvm = (ViewModel.MainWindowViewModel)parentWindow.DataContext;
                    mvm.SelectedKey = (Model.KeyEntry)e.AddedItems[0];
                }
            }
        }
        public MainWindowView(ViewModel.MainWindowViewModel vm)
        {
            InitializeComponent();

            DataContext = vm;

            PreviewKeyDown += (sender, e) =>
            {
                if (e.Key == Key.F5)
                {
                    System.Diagnostics.Debugger.Break();
                }
            };
        }
Esempio n. 6
0
        private void DeleteKeyContextMenu_Click(object sender, RoutedEventArgs e)
        {
            var dataContext = ((FrameworkElement)e.OriginalSource).DataContext;

            if (dataContext != null)
            {
                Window parentWindow = Window.GetWindow(this);

                Model.KeyEntry OriginalKey = (Model.KeyEntry)dataContext;

                if (MessageBox.Show("Schlüssel löschen?", "Benutzerabfrage", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes)
                {
                    ViewModel.MainWindowViewModel vm = (ViewModel.MainWindowViewModel)parentWindow.DataContext;
                    vm.SelectedGroup.KeyEntries.Remove(OriginalKey);
                }
            }
        }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
        public static int Main(string[] args)
        {
            try
            {
                var app = new App();
                Locator.CurrentMutable.RegisterViewsForViewModels(Assembly.GetAssembly(typeof(App)));

                var vm = new ViewModel.MainWindowViewModel();
                app.Run(new MainWindow {
                    ViewModel = vm
                });
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Error", MessageBoxButton.OK);
            }

            return(0);
        }
 public ConsoleInterpreter(ViewModel.MainWindowViewModel mainVM)
 {
     vm = mainVM;
 }
Esempio n. 10
0
 public MainWindow(ViewModel.MainWindowViewModel vm)
 {
     InitializeComponent();
     DataContext = vm;
 }
Esempio n. 11
0
 public MainWindow()
 {
     InitializeComponent();
     ViewModel.MainWindowViewModel mainVM = new ViewModel.MainWindowViewModel();
     this.DataContext = mainVM;
 }
 public MainWindowModel(ViewModel.MainWindowViewModel vm)
 {
     this.vm = vm;
 }
Esempio n. 13
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = new ViewModel.MainWindowViewModel(this);
        }
Esempio n. 14
0
 public Modifier()
 {
     InitializeComponent();
     DataContext = new ViewModel.MainWindowViewModel();
 }
Esempio n. 15
0
 public NotificationManager(ViewModel.MainWindowViewModel ViewModel)
 {
     this.ViewModel = ViewModel;
 }