예제 #1
0
            public override DIRECTION translateMove(NodeL from, NodeL to, ref View v)
            {
                int second = to.x - from.x;
                int first  = to.y - from.y;

                if (first > 0) // dolu
                {
                    v = new DownView();
                    return(DIRECTION.DIRECTION_BACKWARD);
                }
                else if (first < 0) // nahoru
                {
                    return(DIRECTION.DIRECTION_FORWARD);
                }
                else if (second > 0) // doprava
                {
                    v = new RightView();
                    return(DIRECTION.DIRECTION_RIGHT);
                }
                else if (second < 0)// doleva
                {
                    v = new LeftView();
                    return(DIRECTION.DIRECTION_LEFT);
                }
                else
                {
                    return(DIRECTION.WAIT);
                }
            }
예제 #2
0
        public IntroductionViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            this.regionManager     = regionManager;
            this.module_Aggregator = eventAggregator;
            this.send_Aggregator   = eventAggregator;

            moduleMsgOrder = new ModuleMsgOrder();

            _gameModel = GameModel.CreateNewModel();
            _listModel = ListModel.CreateNewModel();
            downView   = new DownView(new DownViewModel(), eventAggregator);

            RequestEvent();
        }
예제 #3
0
        public static void Create(Canvas p, Thickness m)
        {
            Setting.GetRootFolder((r) => rsf = r);
            parent = p;
            black  = new Button();
            p.Children.Add(black);
            black.Content = "进入全黑,双击点亮,打开节电模式,关闭金刚键";
            black.Click  += (o, e) => {
                if (display == null)
                {
                    display = new DisplayRequest();
                }
                display.RequestActive();
                bor.Visibility = Visibility.Visible;
#if phone
                ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
#endif
            };
            black.Margin        = m;
            m.Top              += 30;
            detail              = Component.CreateTextBlockNext();
            detail.Foreground   = Component.font_brush;
            detail.TextWrapping = TextWrapping.Wrap;
            detail.Margin       = m;
            detail.Width        = m.Right - m.Left;

            detail.Height = 70;
            p.Children.Add(detail);

            dv        = new DownView();
            dv.Play   = Play;
            dv.Delete = Delete;
            dv.SetParent(p);
            m.Top += 70;

            dv.Resize(m);
            dv.data = lm;
            dv.Refresh();
            dv.ShowBorder();
            Show = (s) => { detail.Text = s; dv.Refresh(); };

            CreatBlack();
        }