OSDN Git Service

あるバグの再現のためにドキュメントを追加できるようにした
authortest <test@yahoo.co.jp>
Fri, 20 Apr 2018 10:47:57 +0000 (19:47 +0900)
committertest <test@yahoo.co.jp>
Fri, 20 Apr 2018 10:47:57 +0000 (19:47 +0900)
UWP/Test/MainPage.xaml
UWP/Test/MainPage.xaml.cs
UWP/Test/MainViewModel.cs

index 0d186ad..8893e83 100644 (file)
@@ -28,6 +28,7 @@
         <StackPanel Grid.Row="1" >
             <Button Content="Load" Click="Button_Click"/>
             <Button Content="Print" Click="Print_Button_Click"/>
+            <Button Content="New" Click="Button_Click_New"/>
         </StackPanel>
     </Grid>
 </Page>
index 5ae0671..0e7ebe1 100644 (file)
@@ -100,5 +100,10 @@ namespace Test
         {
             await PrintManager.ShowPrintUIAsync();
         }
+
+        private void Button_Click_New(object sender, RoutedEventArgs e)
+        {
+            this.vm.AddDocument();
+        }
     }
 }
index 4bb19f3..98ebf3e 100644 (file)
@@ -64,7 +64,14 @@ namespace Test
         public event EventHandler CurrentDocumentChanged;
         
         public event PropertyChangedEventHandler PropertyChanged;
-        
+
+        public void AddDocument()
+        {
+            var doc = new Document() { Title = "test" + this._list.Count };
+            this._list.Add(doc);
+            this.CurrentDocument = this._list.Last();
+        }
+
         private void OnPropertyChanged(object sender, [System.Runtime.CompilerServices.CallerMemberName] string name = "")
         {
             if(this.PropertyChanged != null)