Esempio n. 1
0
 public GameScreenSelectViewModel(List <Rectangle> rectList, SelectGameWindowAction dg)
 {
     this.rectList = rectList;
     this.dg       = dg;
     // プロパティを設定
     PageInfoStr    = RectIndex.Select(x => $"[{x + 1}/{rectList.Count}] {Utility.GetRectStr(rectList[x])}").ToReadOnlyReactiveProperty();
     GameWindowPage = RectIndex.Select(x => (BitmapSource)ScreenShotProvider.GetScreenBitmap(rectList[x]).ToImageSource()).ToReadOnlyReactiveProperty();
     // コマンドを設定
     PrevPageCommand.Subscribe(_ => {
         RectIndex.Value = (rectList.Count + RectIndex.Value - 1) % rectList.Count;
     });
     NextPageCommand.Subscribe(_ => {
         RectIndex.Value = (rectList.Count + RectIndex.Value + 1) % rectList.Count;
     });
     SelectPageCommand.Subscribe(_ => {
         dg(rectList[RectIndex.Value]);
         CloseWindow.Value = true;
     });
     CancelCommand.Subscribe(_ => {
         dg(null);
         CloseWindow.Value = true;
     });
 }
Esempio n. 2
0
 public void Initialize()
 {
     m_pageService.Initialize();
     SelectPageCommand.Execute(CurrentPage.GetType());
 }