Interaction logic for SyncedProjectsControl.xaml
Inheritance: System.Windows.Controls.UserControl
Esempio n. 1
0
        private void AddControl()
        {
            SyncedProjectsViewModel viewModel = new SyncedProjectsViewModel();
            var control = new SyncedProjectsControl();
            control.DataContext = viewModel;

            var defaultTab = PluginManager.LeftTab;

            this.AddToTab(defaultTab, control, "Projects");
            this.ReactToLoadedGlux += delegate
            {
                viewModel.Refresh();
            };
            this.ReactToLoadedSyncedProject += delegate
            {
                viewModel.Refresh();
            };
        }
Esempio n. 2
0
        private void AddControl()
        {
            SyncedProjectsViewModel viewModel = new SyncedProjectsViewModel();

            viewModel.CurrentProject = GlueState.Self.CurrentMainProject;
            viewModel.SyncedProjects = GlueState.Self.SyncedProjects;

            var control = new SyncedProjectsControl();

            control.DataContext = viewModel;

            var defaultTab = PluginManager.LeftTab;

            this.AddToTab(defaultTab, control, "Projects");
            this.ReactToLoadedGlux += delegate
            {
                viewModel.CurrentProject = GlueState.Self.CurrentMainProject;
                viewModel.SyncedProjects = GlueState.Self.SyncedProjects;

                viewModel.Refresh();
            };
            this.ReactToLoadedSyncedProject += delegate
            {
                viewModel.CurrentProject = GlueState.Self.CurrentMainProject;
                viewModel.SyncedProjects = GlueState.Self.SyncedProjects;


                viewModel.Refresh();
            };
            this.ReactToUnloadedGlux += delegate
            {
                viewModel.CurrentProject = null;
                viewModel.SyncedProjects = new List <ProjectBase>();


                viewModel.Refresh();
            };
        }