コード例 #1
0
 /// <summary>
 /// Provides a deterministic way to create the CounterViewModel property.
 /// </summary>
 public static void CreateCounterViewModel()
 {
     if (_counterViewModel == null)
     {
         _counterViewModel = new CounterViewModel();
     }
 }
コード例 #2
0
 /// <summary>
 /// Provides a deterministic way to delete the CounterViewModel property.
 /// </summary>
 public static void ClearCounterViewModel()
 {
     _counterViewModel.Cleanup();
     _counterViewModel = null;
 }