Пример #1
0
        public Nav()
		{
			this.InitializeComponent();
            instance = this;

            NavItem.NumItems = 0;
            Sections.Children.Add(new NavItem("Welcome", typeof(Welcome)));
            Sections.Children.Add(new NavItem("Home", typeof(Home)));
            Sections.Children.Add(new NavItem("Account", typeof(Account)));
            Sections.Children.Add(new NavItem("Portfolio", new Portfolio()));
            Sections.Children.Add(new NavItem("Orders", new Order()));
            Sections.Children.Add(new NavItem("Quotes/Trade", new Quotes()));
            Sections.Children.Add(new NavItem("Config", new Configuration()));
            Sections.Children.Add(new NavItem("Glossary", typeof(Glossary)));
            Sections.Children.Add(new NavItem("Login/Logout", new Login()));

            TradeSection = new NavItem("Trade", typeof(Trade));
            OrderSection = new NavItem("Order", typeof(Order));
            RegisterSection = new NavItem("Register", typeof(Register));

            for (int i = 0; i < Sections.Children.Count; i++)
            {
                (Sections.Children[i] as NavItem).Click += new EventHandler(onClickNav);
            }
		}
Пример #2
0
 void onClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (SelectedItem == this) return;
     if (SelectedItem != null)
         DeSelect.Begin(SelectedItem);
     Select.Begin(this);
     SelectedItem = this;
     Click(this, e);
 }
Пример #3
0
 public void Activate()
 {
     if (SelectedItem != this)
     {
         if (SelectedItem != null)
             DeSelect.Begin(SelectedItem);
         Select.Begin(this);
         SelectedItem = this;
     }
     Click(this, null);
 }
Пример #4
0
 void onClickNav(object sender, EventArgs e)
 {
     SelectedItem = sender as NavItem;
     ChangeSection(this, e);
 }