Пример #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            SnippetWindow snipetWindow = new SnippetWindow();

            snipetWindow.NewSnippet += SnipetWindow_NewSnippet;
            snipetWindow.Show();
            this.Activate();
        }
Пример #2
0
        private void NewSimilarSnippet_Click(object sender, RoutedEventArgs e)
        {
            SnippetWindow snipetWindow = new SnippetWindow();

            if (snipetWindow.ShowDialog() == true && snipetWindow.Snippet != null)
            {
                this.ViewModel.SimilarSnippetTaken(snipetWindow.Snippet);
            }
        }
Пример #3
0
        private void UpdateButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.ViewModel.Snippet == null)
            {
                return;
            }
            SnippetWindow snipetWindow = new SnippetWindow();

            snipetWindow.Snippet = this.ViewModel.Snippet;
            snipetWindow.LoadSnippet();
            if (snipetWindow.ShowDialog() == true && snipetWindow.Snippet != null)
            {
                this.ViewModel.SnippetUpdated(snipetWindow.Snippet);
            }
        }