예제 #1
0
        private void Tile_Click(object sender, RoutedEventArgs e)
        {
            Tile     tile = (Tile)sender;
            WorkItem item = (WorkItem)tile.Tag;

            if (WindowList.ContainsKey(item))
            {
                WindowList[item].Close += frame_Close;
                ContentControl.Content  = WindowList[item];
                return;
            }
            WorkFrame frame = new WorkFrame();

            frame.MainTitle = item.Name;
            WorkPage content = item.GetWorkPage();

            WindowList.Add(item, frame);
            MenuItem menu = new MenuItem();

            menu.Tag    = frame;
            menu.Click += Menu_Click;
            menu.SetBinding(MenuItem.HeaderProperty, new Binding {
                Source = frame, Mode = BindingMode.OneWay, Path = new PropertyPath("Content.Title")
            });
            WindowMenu.Items.Add(menu);
            frame.Close += frame_Close;
            frame.Close += (s, ee) =>
            {
                WindowList.Remove(item);
                WindowMenu.Items.Remove(menu);
                ContentControl.Content = StartMenu;
            };
            ContentControl.Content = frame;
            frame.NavigationService.NavigateTo(content);
        }
예제 #2
0
 protected virtual void OnNavigatedFrom(WorkPage page)
 {
     if (NavigatedFrom != null)
     {
         NavigatedFrom(this, page);
     }
 }
예제 #3
0
 protected virtual void OnNavigatedTo(WorkPage page)
 {
     if (NavigatedTo != null)
     {
         NavigatedTo(page, this);
     }
 }
예제 #4
0
 public void NavigateTo(WorkPage page)
 {
     WorkPage old = Frame.Content;
     Frame.Content = page;
     if (old != null)
     {
         History.Push(old);
         old.BaseNavigateFrom(page);                
     }
     if (page != null)
         page.BaseNavigateTo(old);
     if (Navigated != null)
         Navigated(old, page);
 }
예제 #5
0
 internal void BaseNavigateFrom(WorkPage page)
 {
     OnNavigatedFrom(page);
 }
예제 #6
0
 internal void BaseNavigateTo(WorkPage page)
 {
     OnNavigatedTo(page);
 }
예제 #7
0
 protected virtual void OnNavigatedFrom(WorkPage page)
 {
     if (NavigatedFrom != null)
         NavigatedFrom(this, page);
 }
예제 #8
0
 protected virtual void OnNavigatedTo(WorkPage page)
 {
     if (NavigatedTo != null)
         NavigatedTo(page, this);
 }
예제 #9
0
 internal void BaseNavigateFrom(WorkPage page)
 {
     OnNavigatedFrom(page);
 }
예제 #10
0
 internal void BaseNavigateTo(WorkPage page)
 {
     OnNavigatedTo(page);
 }