示例#1
0
 private void tip2_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
 {
     tip2.IsOpen = false;
     SubListView.SelectedIndex = 0;
     GoToDownloadPage();
     SubsceneDownloadPage.Instance.ShowTip1();
 }
示例#2
0
        public void ShowTip(string text)
        {
            TeachingTip teachingTip = (TeachingTip)FindName("infoTip");

            teachingTip.Subtitle = text;
            teachingTip.IsOpen   = true;
        }
 public PageHeader()
 {
     this.InitializeComponent();
     TeachingTip1 = ToggleThemeTeachingTip1;
     TeachingTip2 = ToggleThemeTeachingTip2;
     TeachingTip3 = ToggleThemeTeachingTip3;
 }
示例#4
0
 private void CommentTeachingTip_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
 {
     if (_chatBoxStateManager != null)
     {
         _chatBoxStateManager.ThreadMessage = null;
     }
 }
        private static void MainMenuTeachingTip_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
        {
            if (_mainMenuTeachingTip != null)
            {
                _mainMenuTeachingTip.Closed -= MainMenuTeachingTip_Closed;
            }

            DisplayReplayButtonTip();
        }
示例#6
0
 private void TeachingTipTestHooks_IdleStatusChanged(TeachingTip sender, object args)
 {
     if (TeachingTipTestHooks.GetIsIdle(this.TestTeachingTip))
     {
         this.IsIdleCheckBox.IsChecked = true;
     }
     else
     {
         this.IsIdleCheckBox.IsChecked = false;
     }
 }
示例#7
0
 private void TeachingTipTestHooks_OpenedStatusChanged(TeachingTip sender, object args)
 {
     if (this.TestTeachingTip.IsOpen)
     {
         this.IsOpenCheckBox.IsChecked = true;
     }
     else
     {
         this.IsOpenCheckBox.IsChecked = false;
     }
 }
示例#8
0
        private void TeachingTip_OnActionButtonClick(TeachingTip sender, object args)
        {
            if (sender == HelpTip1)
            {
                sender.IsOpen   = false;
                HelpTip2.IsOpen = true;
            }

            if (sender == HelpTip2)
            {
                sender.IsOpen   = false;
                HelpTip3.IsOpen = true;
            }
        }
        private static void MainMenuTimer_Tick(object sender, object e)
        {
            (sender as DispatcherTimer).Stop();

            if (_mainMenuTeachingTip == null)
            {
                return;
            }

            // Close and cleanup the TeachingTip
            _mainMenuTeachingTip.IsOpen = false;
            (_mainMenuTeachingTip.Parent as Grid).Children.Remove(_mainMenuTeachingTip);
            // _mainMenuTeachingTip.Closed -= MainMenuTeachingTip_Closed; --> too early
            _mainMenuTeachingTip = null;
        }
示例#10
0
        /// <summary>
        /// Displays the TeachingTip for the Replay button.
        /// </summary>
        public static void DisplayReplayButtonTip()
        {
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            if (localSettings.Values["replayButtonTeachingTipDisplayed"] != null &&
                localSettings.Values["replayButtonTeachingTipDisplayed"].ToString() == "True")
            {
                return;
            }

            // Find the Main menu item and the Content grid.
            var frame    = Navigation.Frame;
            var homePage = frame?.Content as HomePage;

            if (homePage == null)
            {
                // We're already off the home page.
                return;
            }

            var replayButton = homePage?.FindName("ReplayButton") as Button;

            _replayButtonTeachingTip = new TeachingTip
            {
                Target      = replayButton,
                Title       = "Click to replay",
                Content     = "Don't worry, you'll never see this tip again. " + Environment.NewLine + "Promised! 🤞",
                HeroContent = new Image
                {
                    Source = new BitmapImage(new Uri("ms-appx:///Assets/FriendsDontLie.jpg"))
                },
                PreferredPlacement = TeachingTipPlacementMode.Right, // Ignored since there's not enough space.
                IsOpen             = true,
                BorderThickness    = new Thickness(.5),
                BorderBrush        = new SolidColorBrush(Colors.DarkRed)
            };

            localSettings.Values["replayButtonTeachingTipDisplayed"] = "True";

            (homePage.Content as Grid).Children.Add(_replayButtonTeachingTip);
        }
        /// <summary>
        /// Displays the TeachingTip for the Main menu item, and hides it after 5 seconds.
        /// </summary>
        public static void DisplayMainMenuTip()
        {
            // Find the Main menu item and the Content grid.
            var shell        = (Window.Current.Content as Frame)?.Content as FrameworkElement;
            var contentGrid  = shell?.FindName("ContentGrid") as Grid;
            var menu         = shell?.FindName("Menu") as ListView;
            var mainPageMenu = menu?.ContainerFromIndex(1) as ListViewItem;

            // The menu item itself would make a good target for the teaching tip,
            // but let's be ambitious and dive deeper to find its icon.
            var itemsPresenter = ((VisualTreeHelper.GetChild(mainPageMenu, 0)) as FrameworkElement);
            var stackPanel     = ((VisualTreeHelper.GetChild(itemsPresenter, 0)) as FrameworkElement);
            var glyph          = stackPanel?.FindName("Glyph") as FrameworkElement;

            _mainMenuTeachingTip = new TeachingTip
            {
                Target      = glyph,
                Title       = "Welcome",
                Content     = "The Main page is where all the action is.",
                HeroContent = new Image
                {
                    Source = new BitmapImage(new Uri("ms-appx:///Assets/MindFlayer.jpg"))
                },
                PreferredPlacement = TeachingTipPlacementMode.BottomRight,
                IsOpen             = true,
                BorderThickness    = new Thickness(.5),
                BorderBrush        = new SolidColorBrush(Colors.DarkRed)
            };
            _mainMenuTeachingTip.Closed += MainMenuTeachingTip_Closed;

            contentGrid.Children.Add(_mainMenuTeachingTip);
            var timer = new DispatcherTimer();

            timer.Tick    += MainMenuTimer_Tick;
            timer.Interval = TimeSpan.FromSeconds(5);
            timer.Start();
        }
示例#12
0
 private void tip2_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
 {
     tip2.IsOpen = false;
     SubscenePage.Instance.ShowTip1();
 }
 private void tip8_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
 {
     tip8.IsOpen = false;
     Helper.Settings.IsFirstRun = false;
 }
 private void tip7_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
 {
     tip7.IsOpen = false;
     tip8.IsOpen = true;
 }
示例#15
0
 private void TeachingTip_OnCloseButtonClick(TeachingTip sender, object args)
 {
     sender.IsOpen = false;
 }
示例#16
0
 private void OnCopyDontShowAgainButtonClick(TeachingTip sender, object args)
 {
     ProtocolActivationClipboardHelper.ShowCopyLinkTeachingTip = false;
     this.CopyLinkButtonTeachingTip.IsOpen = false;
 }
示例#17
0
 private void tip1_Closed(TeachingTip sender, TeachingTipClosedEventArgs args)
 {
     AutoSuggest.Text = Constants.GuidSubtitle;
     tip1.IsOpen      = false;
     SearchSubtitle(AutoSuggest.Text);
 }