Ejemplo n.º 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;
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }