Пример #1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string ident;
            if (NavigationContext.QueryString.TryGetValue("id", out ident))
            {
                int i = int.Parse(ident);
                this.Entry = this.State().OpenColors[i];
            }

            string backHint; bool shouldShowBackHint = false;
            if (NavigationContext.QueryString.TryGetValue("shouldShowBackHint", out backHint))
                shouldShowBackHint = (backHint == "true");

            if (shouldShowBackHint)
            {
                Storyboard ani = (Storyboard) Resources["ShowHideBackButtonHint"];
                ani.Begin();
            }
            else
                this.State().EditingEntry = this.Entry;
        }
Пример #2
0
 internal Uri UriToEditColorPage(ColorEntry e, bool shouldShowBackHint = false)
 {
     int i = State.OpenColors.IndexOf(e);
     if (i != -1)
         return new Uri("/EditColor.xaml?id=" + i + "&shouldShowBackHint=" + (shouldShowBackHint? "true" : "false"), UriKind.Relative);
     else
         return null;
 }
Пример #3
0
        public static void NavigateToNewColorPage(this Page page, ColorEntry e)
        {
            State s = page.State();

            while (s.OpenColors.Count > 2)
                s.OpenColors.RemoveAt(0);

            if (!s.OpenColors.Contains(e))
                s.OpenColors.Add(e);

            page.NavigateToEditColorPage(e);
        }
Пример #4
0
 public static void NavigateToEditColorPage(this Page page, ColorEntry e, bool shouldShowBackHint = false)
 {
     Uri u = App.Instance.UriToEditColorPage(e, shouldShowBackHint);
     if (u != null)
         page.NavigationService.Navigate(u);
 }