예제 #1
0
        public MainWindow(string sessionId)
        {
            InitializeComponent();

            MainWindowViewModel mainModel = new MainWindowViewModel(sessionId);
            DataContext = mainModel;

            mainModel.ViewSwitchCommand = new ActionCommand(SwithView);

            // Re-focus to the content of the list item
            DrawerMenuList.AddHandler(MouseDownEvent,
                    new MouseButtonEventHandler(delegate
                    {
                        var item = DrawerMenuList.SelectedItem as MenuItem;

                        var view = item.Relationship.View;
                        if (view == null)
                        {
                            (item.Relationship.ViewModel as CommandViewModel).Execute();
                            return;
                        }

                        ViewContainer.Content = view;
                    }), true);

            // Default view
            ViewContainer.Content = mainModel.ChildViewList["profile"].View;

            DialogHelper.SetupInvoke(this, "MainRootDialog");
        }
예제 #2
0
 public ProfileViewModel(MainWindowViewModel MainViewModel, string SessionId)
 {
     this.MainViewModel = MainViewModel;
     this.SessionId = SessionId;
 }