コード例 #1
0
        public SecondLandscapePage()
        {
            this.InitializeComponent();
            Callouts.SetTitle = (string title) => {
                if (firstTitle)
                {
                    Title.Text = title;
                }
                firstTitle = false;
                var def = DefinitionFrame.Content as DefinitionPage;
                if (def != null)
                {
                    def.setTitle(title);
                }
            };
            Callouts.AnimationSelected = (AnimListItem item) => {
                Dictionary <string, string> intent = new Dictionary <string, string>();
                intent["anim"]  = item.animnumber.ToString();
                intent["title"] = item.title;
                //  TODO calltitle
                intent["name"]  = item.group + " " + item.name;
                intent["link"]  = this.Intent()["link"];
                intent["level"] = ""; // TODO
                FrameUtilities.Navigate(AnimationFrame, typeof(AnimationPage), intent);
            };
            Callouts.FirstAnimationReady       = Callouts.AnimationSelected;
            Callouts.AnimationDefinitionAction = (string link) => {
                FrameUtilities.Navigate(DefinitionFrame, typeof(DefinitionPage), this.Intent());
            };
            Callouts.AnimationSettingsAction = () => {
                FrameUtilities.Navigate(DefinitionFrame, typeof(SettingsPage), this.Intent());
            };
            Callouts.settingsChanged = () => {
                var animation = (AnimationView)((FrameworkElement)AnimationFrame.Content).FindName("animationView");
                switch (settings.Values["geometry"]?.ToString())
                {
                case "Hexagon": animation.setHexagon(); break;

                case "Bigon": animation.setBigon(); break;

                default: animation.setSquare(); break;
                }
                animation.setGridVisibility(settings.Values["grid"]?.ToString() == "On");
                animation.setLoop(settings.Values["loop"]?.ToString() == "On");
                animation.setPathVisibility(settings.Values["paths"]?.ToString() == "On");
                animation.setPhantomVisibility(settings.Values["phantoms"]?.ToString() == "On");
                animation.setSpeed(settings.Values["speed"]?.ToString());
                animation.setNumbers(settings.Values["numbers"]?.ToString());
                //  TODO show Loop and Speed options
            };
            FrameUtilities.Navigate(AnimListFrame, typeof(AnimListPage), this.Intent());
            var buttonpanel = (Grid)((FrameworkElement)AnimListFrame.Content).FindName("ButtonPanel");

            buttonpanel.Visibility = Visibility.Collapsed;
            FrameUtilities.Navigate(DefinitionFrame, typeof(DefinitionPage), this.Intent());
            Level.Content = LevelData.find(this.Intent()["link"].Split('/')[0]).name;
        }
コード例 #2
0
 public FirstLandscapePage()
 {
     this.InitializeComponent();
     Callouts.SetTitle = (string title) => {
         if (!title.Contains("Taminations"))
         {
             title = "Taminations - " + title;
         }
         Title.Text = title;
     };
     Callouts.LevelButtonAction = (string level) => {
         Dictionary <string, string> intent = new Dictionary <string, string>();
         intent["level"] = level;
         FrameUtilities.Navigate(RightFrame, typeof(CallListPage), intent);
     };
     Callouts.AboutAction = () => {
         FrameUtilities.Navigate(RightFrame, typeof(AboutPage), new Dictionary <string, string>());
     };
     Callouts.LevelSettingsAction = () => {
         FrameUtilities.Navigate(RightFrame, typeof(SettingsPage), new Dictionary <string, string>());
     };
     Callouts.CallSelected = (string link) => {
         Dictionary <string, string> intent = new Dictionary <string, string>();
         intent["link"] = link;
         this.Navigate(typeof(SecondLandscapePage), intent);
     };
     Callouts.SequencerAction = () => {
         this.Navigate(typeof(SequencerLandscapePage), new Dictionary <string, string>());
     };
     Back.Visibility = Visibility.Collapsed;
     LeftFrame.Navigate(typeof(LevelPage));
     if (PageUtilities.intents.ContainsKey(typeof(CallListPage)))
     {
         RightFrame.Navigate(typeof(CallListPage));
     }
     else
     {
         RightFrame.Navigate(typeof(AboutPage));
     }
 }
コード例 #3
0
 public SequencerLandscapePage()
 {
     this.InitializeComponent();
     FrameUtilities.Navigate(SequencerFrame, typeof(SequencerPage), this.Intent());
 }