예제 #1
0
        public MainPage()
        {
            this.InitializeComponent();

            GlobalSettings.ApplyDefaults();
            GlobalSettings.ApplyThemeTo(this);

            Press.DirectionBrushes = new List <Brush>();
            Press.DirectionBrushes.Insert((int)Math.Sqrt((int)Press.DIRECTION.PRESSED), new SolidColorBrush(Colors.LawnGreen));
            Press.DirectionBrushes.Insert((int)Math.Sqrt((int)Press.DIRECTION.UP), new SolidColorBrush(Colors.Red));
            Press.DirectionBrushes.Insert((int)Math.Sqrt((int)Press.DIRECTION.DOWN), new SolidColorBrush(Colors.Yellow));
            Press.DirectionBrushes.Insert((int)Math.Sqrt((int)Press.DIRECTION.LEFT), new SolidColorBrush(Colors.DodgerBlue));
            Press.DirectionBrushes.Insert((int)Math.Sqrt((int)Press.DIRECTION.RIGHT), new SolidColorBrush(Colors.White));
            Press.DirectionBrushes.Insert((int)Math.Sqrt((int)Press.DIRECTION.NONE), new SolidColorBrush(Colors.LawnGreen));

            Press.DirectionHit = new List <double>();
            Press.DirectionHit = new List <double>();

            Press.DirectionHit.Insert((int)Math.Sqrt((int)Press.DIRECTION.PRESSED), 0.1);
            Press.DirectionHit.Insert((int)Math.Sqrt((int)Press.DIRECTION.UP), 0.1);
            Press.DirectionHit.Insert((int)Math.Sqrt((int)Press.DIRECTION.DOWN), 0.1);
            Press.DirectionHit.Insert((int)Math.Sqrt((int)Press.DIRECTION.LEFT), 0.1);
            Press.DirectionHit.Insert((int)Math.Sqrt((int)Press.DIRECTION.RIGHT), 0.1);
            Press.DirectionHit.Insert((int)Math.Sqrt((int)Press.DIRECTION.NONE), 0.1);

            NavView.ItemInvoked += NavigationView_OnItemInvoked;

            NavView.SelectionChanged += (s, e) =>
            {
                if (_lastItem == null)
                {
                    return;
                }
            };

            NavView.Loaded += (s, e) =>
            {
                var settings = (NavigationViewItem)NavView.SettingsItem;
                settings.IsTabStop   = false;
                NavView.PaneClosing += (ss, ee) =>
                {
                    NavView.IsPaneOpen = true;
                };
            };

            ContentFrame.Navigate(typeof(HomePage));
            Home_Navigation.IsSelected = true;
        }
예제 #2
0
 private void Default_Button_Click(object sender, RoutedEventArgs e)
 {
     GlobalSettings.ApplyDefaults();
     Defaults();
 }