Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using DiceExpressions.Model;
  2. using DiceExpressions.ViewModels;
  3. using Reactive.Bindings;
  4. using ReactiveUI;
  5. using PType = System.Double;
  6.  
  7. namespace DiceExpressions.ViewModel
  8. {
  9.     public class DiceExpressionsViewModel : ViewModelBase
  10.     {
  11.         private string _plot;
  12.  
  13.         public DiceExpressionsViewModel()
  14.         {
  15.             var d1 = new Die(20);
  16.             var d2 = new Constant<PType>((PType)1.7);
  17.             var d3=d1+d2;
  18.             var d4 = d1.ArithMult(3);
  19.             var d5 = d1.ArithMult(d1);
  20.             _plot = d5.Plot();
  21.             Plot2 = new ReactiveProperty<string>(d5.Plot());
  22.            
  23.             d5.GetOxyPlotSvg("Test");
  24.             d5.SaveOxyPlotPdf("test.pdf");
  25.         }
  26.  
  27.         public ReactiveProperty<string> Plot2 { get; }
  28.  
  29.         public string Plot
  30.         {
  31.             get { return _plot; }
  32.             set { this.RaiseAndSetIfChanged(ref _plot, value); }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement