示例#1
0
        private void LoadToolbar()
        {
            // VEFModule.EventAggregator.GetEvent<SplashMessageUpdateEvent>().Publish(new SplashMessageUpdateEvent { Message = "Toolbar.." });
            var toolbarService = VEFModule.UnityContainer.Resolve(typeof(ToolbarService), "") as ToolbarService;
            var menuService    = VEFModule.UnityContainer.Resolve(typeof(MenuItemViewModel), "") as MenuItemViewModel;

            toolbarService.Add(new ToolbarViewModel("Standard", 1)
            {
                Band = 0, BandIndex = 0, IsChecked = true
            });
            toolbarService.Get("Standard").Add(menuService.Get(Resources._File).Get(Resources._New));
            toolbarService.Get("Standard").Add(menuService.Get(Resources._File).Get(Resources._Open));
            toolbarService.Get("Standard").Add(menuService.Get(Resources._File).Get(Resources._Save));

            var tb = new ToolbarViewModel("_Edit", 1)
            {
                Band = 0, BandIndex = 1,
            };

            tb.IsChecked = false;
            toolbarService.Add(tb);
            toolbarService.Get("_Edit").Add(menuService.Get("_Edit").Get("_Undo"));
            //toolbarService.Get(Resources.Edit).Add(menuService.Get(Resources._Edit).Get(Resources._Redo));
            //toolbarService.Get(Resources.Edit).Add(MenuItemViewModel.Separator(3));
            //toolbarService.Get(Resources.Edit).Add(menuService.Get(Resources._Edit).Get(Resources.Cut));
            //toolbarService.Get(Resources.Edit).Add(menuService.Get(Resources._Edit).Get(Resources.Copy));
            //toolbarService.Get(Resources.Edit).Add(menuService.Get(Resources._Edit).Get(Resources._Paste));

            menuService.Get("_Tools").Add(toolbarService.RightClickMenu);

            toolbarService.ToolBarTrayVisible = false;

            //Initiate the position settings changes for toolbar
            VEFModule.UnityContainer.Resolve(typeof(ToolbarPositionSettings), "");
        }
示例#2
0
 /// <summary>
 /// Provides a deterministic way to create the ToolbarVMStatic property
 /// </summary>
 public static void CreateToolbarVM()
 {
     if (toolbarVM == null)
     {
         toolbarVM = new ToolbarViewModel();
     }
 }
示例#3
0
        // States Interface

        public void SwitchToState(ApplicationContext app_context_p)
        {
            // Store the app context for later use.
            ApplicationContext_m = app_context_p;

            // Test ToolbarViewModel
            ToolbarViewModel toolbar_view_model = new ToolbarViewModel();

            toolbar_view_model.Title            = "Transaction Register";
            toolbar_view_model.Background_Color = Brushes.Blue;
            toolbar_view_model.Font_Color       = Brushes.White;
            toolbar_view_model.Naigation_btn    = GUIUtilites.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click, 56, 56, 24, 24, Brushes.Transparent, Brushes.Transparent, HorizontalAlignment.Center, VerticalAlignment.Center);

            ToolbarController_m.UpdateViews(toolbar_view_model);

            // Test WorkspaceViewModel
            WorkspaceViewModel workspacce_view_modle = new WorkspaceViewModel();

            TransactionsView temp_trans_view = new TransactionsView();

            temp_trans_view.TransactionsLB.Items.Add("Test Deposit");

            // Add Workspace Gid to Workspace
            workspacce_view_modle.Controls_m.Add(temp_trans_view);

            // Create actual image button.
            //Button image_button = GUIUtilites.BuildImageButton("../images/EditWhite.png", AddTransactionBtn_Click, 56, 56, 24, 24, Brushes.SeaGreen, Brushes.Transparent, HorizontalAlignment.Right, VerticalAlignment.Bottom);
            //workspacce_view_modle.Controls_m.Add(image_button);

            WorkspaceController_m.UpdateViews(workspacce_view_modle);
        }
            public static ToolbarViewModel Build( )
            {
                if (null == _instance)
                {
                    _instance = new ToolbarViewModel( );

                    ToolbarGroup framesGroup = new ToolbarGroup( )
                    {
                        Name = "WADO-RS-Frames*"
                    };
                    ToolbarGroup WadoUriGroup = new ToolbarGroup( )
                    {
                        Name = "WADO-URI"
                    };


                    framesGroup.Add(new ToolbarInput("frame list (e.g. 1,4,6)", "text", "data-rs-frames-input"));
                    framesGroup.Add(new ToolbarLink("Uncompressed", "data-rs-frames", MimeTypes.UncompressedData));

                    WadoUriGroup.Add(new ToolbarInput("single frame number (optional)", "text", "data-uri-frame-input"));
                    WadoUriGroup.Add(new ToolbarLink("DICOM", "data-uri-instance", MimeTypes.DICOM));

                    _instance.Add(framesGroup);
                    _instance.Add(WadoUriGroup);
                }

                return(_instance);
            }
        private void AddToolbar(ToolbarViewModel toolbarViewModel)
        {
            var toolbar = new ToolBar();

            toolbar.DataContext = toolbarViewModel;
            toolbar.ToolTip     = toolbarViewModel.Name;
            toolbar.ItemsSource = toolbarViewModel.ControlItems;

            _toolBarTray.ToolBars.Add(toolbar);
        }
示例#6
0
        public void DefaultToolbarTest()
        {
            // Test ToolbarViewModel
            ToolbarViewModel toolbar_view_model = new ToolbarViewModel();

            toolbar_view_model.Title            = "Testing Title";
            toolbar_view_model.Background_Color = Brushes.Blue;
            toolbar_view_model.Font_Color       = Brushes.White;
            toolbar_view_model.Naigation_btn    = toolbar_view_model.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click);

            toolbar_controller_m.UpdateViews(toolbar_view_model);
        }
示例#7
0
        public ActionResult _Toolbar()
        {
            ContextModel     context = _contextService.GetContext();
            ToolbarViewModel toolbar = SharedViewService.GetToolbar(context);

            //if(context.ActualPage == enPage.Machine)
            //    return PartialView(toolbar);
            //else
            //    return null;

            return(PartialView(toolbar));
        }
示例#8
0
        public void DefaultToolbarTest()
        {
            // Test ToolbarViewModel
            ToolbarViewModel toolbar_view_model = new ToolbarViewModel();

            toolbar_view_model.Title            = "Testing Title";
            toolbar_view_model.Background_Color = Brushes.Blue;
            toolbar_view_model.Font_Color       = Brushes.White;
            toolbar_view_model.Naigation_btn    = GUIUtilites.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click, 56, 56, 24, 24, Brushes.Transparent, Brushes.Transparent, HorizontalAlignment.Center, VerticalAlignment.Center);

            toolbar_controller_m.UpdateViews(toolbar_view_model);
        }
 void ToolbarGroups_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     switch (e.Action)
     {
     case NotifyCollectionChangedAction.Add:
         foreach (var newItem in e.NewItems)
         {
             ToolbarViewModel toolbarViewModel = newItem as ToolbarViewModel;
             AddToolbar(toolbarViewModel);
         }
         break;
     }
 }
示例#10
0
        public ActionResult Index(string href)
        {
            ToolbarViewModel toolbarViewModel = new ToolbarViewModel
            {
                FrameTarget = href
            };

            using (var db = new LinkToolbarContext())
            {
                toolbarViewModel.Links = db.Links.Include(l => l.Links).ToList().Where(l => !l.ParentId.HasValue);
            }
            return(View(toolbarViewModel));
        }
示例#11
0
        public void Draw(BaseModel model_to_draw_p)
        {
            ToolbarViewModel tool_bar_view_model = model_to_draw_p as ToolbarViewModel;

            if (tool_bar_view_model != null)
            {
                Assert.AreEqual(tool_bar_view_model.Title, "Testing Title");
                Assert.AreEqual(tool_bar_view_model.Background_Color, Brushes.Blue);
                Assert.AreEqual(tool_bar_view_model.Font_Color, Brushes.White);
            }
            else
            {
                Assert.Fail("Failed to reterive ToolbarViewModel.");
            }
        }
示例#12
0
        public static ToolbarViewModel GetToolbar(ContextModel context)
        {
            ToolbarViewModel toolbar = new ToolbarViewModel();

            toolbar.page             = context.ActualPage;
            toolbar.role             = context.User.Role;
            toolbar.language         = new LanguageViewModel();
            toolbar.language.initial = context.ActualLanguage.InitialsLanguage;
            toolbar.language.labels  = new CalendarI18nModel();

            if (context.ActualPage == enPage.Mes)
            {
                toolbar.plants         = GetListPlants(context);
                toolbar.selected_plant = toolbar.plants.FirstOrDefault(w => w.id == context.ActualPlant.Id);
                toolbar.period         = new PeriodViewModel();
                toolbar.period.start   = context.ActualPeriod.StartDate;
                toolbar.period.end     = context.ActualPeriod.EndDate;
            }

            if (context.ActualPage == enPage.PlantMessages)
            {
                toolbar.plants         = GetListPlants(context);
                toolbar.selected_plant = toolbar.plants.FirstOrDefault(w => w.id == context.ActualPlant.Id);
                toolbar.period         = new PeriodViewModel();
                if (context.ActualPeriod.StartDate.Year == 1)
                {
                    context.ActualPeriod.StartDate = DateTime.UtcNow.AddDays(-30);
                    context.ActualPeriod.EndDate   = DateTime.UtcNow;
                }

                toolbar.period.start = context.ActualPeriod.StartDate;
                toolbar.period.end   = context.ActualPeriod.EndDate;
            }

            if (context.ActualPage == enPage.Machine || context.ActualPage == enPage.CountersReset)
            {
                toolbar.period       = new PeriodViewModel();
                toolbar.period.start = context.ActualPeriod.StartDate;
                toolbar.period.end   = context.ActualPeriod.EndDate;

                toolbar.machines = GetListMachines(context);

                toolbar.selected_machine = toolbar.machines.FirstOrDefault(w => w.id == context.ActualMachine.Id);
            }

            return(toolbar);
        }
示例#13
0
            public static ToolbarViewModel Build( )
            {
                if (null == _instance)
                {
                    _instance = new ToolbarViewModel( );
                    ToolbarGroup metadataGroup = new ToolbarGroup( )
                    {
                        Name = "WADO-RS-Metadata"
                    };
                    ToolbarGroup instanceGroup = new ToolbarGroup( )
                    {
                        Name = "WADO-RS-Instance*"
                    };
                    ToolbarGroup framesGroup = new ToolbarGroup( )
                    {
                        Name = "WADO-RS-Frames*"
                    };
                    ToolbarGroup WadoUriGroup = new ToolbarGroup( )
                    {
                        Name = "WADO-URI"
                    };

                    metadataGroup.Add(new ToolbarLink("{..}", "data-rs-metadata", MimeTypes.Json));
                    metadataGroup.Add(new ToolbarLink("XML", "data-rs-metadata", MimeTypes.xmlDicom));

                    instanceGroup.Add(new ToolbarLink("DICOM", "data-rs-instance", MimeTypes.DICOM));
                    instanceGroup.Add(new ToolbarLink("Uncompressed", "data-rs-instance", MimeTypes.UncompressedData));
                    //instanceGroup.Add ( new ToolbarLink ( "Jpg", "data-rs-instance", MimeTypes.Jpeg )) ;

                    framesGroup.Add(new ToolbarInput("frame list (e.g. 1,4,6)", "text", "data-rs-frames-input"));
                    framesGroup.Add(new ToolbarLink("Uncompressed", "data-rs-frames", MimeTypes.UncompressedData));
                    //framesGroup.Add ( new ToolbarLink ( "Jpg", "data-rs-frames", MimeTypes.Jpeg )) ;

                    WadoUriGroup.Add(new ToolbarInput("single frame number (optional)", "text", "data-uri-frame-input"));
                    WadoUriGroup.Add(new ToolbarLink("DICOM", "data-uri-instance", MimeTypes.DICOM));

                    _instance.Add(metadataGroup);
                    _instance.Add(instanceGroup);
                    _instance.Add(framesGroup);
                    _instance.Add(WadoUriGroup);
                }

                return(_instance);
            }
示例#14
0
        public void Draw(BaseModel model_to_draw_p)
        {
            ToolbarViewModel tool_bar_view_model = model_to_draw_p as ToolbarViewModel;

            if (tool_bar_view_model != null)
            {
                // Add the child navigation button.
                NavigationSp.Children.Clear();
                NavigationSp.Children.Add(tool_bar_view_model.Naigation_btn);

                // Display Item Modifer Buttons
                ItemModifersSp.Children.Clear();
                foreach (Button temp_button in tool_bar_view_model.ItemModifers)
                {
                    ItemModifersSp.Children.Add(temp_button);
                }

                this.DataContext = tool_bar_view_model;
            }
        }
示例#15
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string dicomFilesPath = txtDicomFilesPath.Text;

            //create tool bar window for this study

            var toolbarWindow    = new ToolbarWindow();
            var toolbarViewModel = new ToolbarViewModel();

            toolbarWindow.DataContext = toolbarViewModel;

            toolbarWindow.Left  = 0;
            toolbarWindow.Top   = 0;
            toolbarWindow.Width = SystemParameters.PrimaryScreenWidth;

            toolbarWindow.Show();

            //load files from folder
            toolbarWindow.LoadThumbnails(dicomFilesPath);
        }
示例#16
0
        // State Interface

        public void SwitchToState(ApplicationContext app_context_p)
        {
            // Store the app context for later use.
            ApplicationContext_m = app_context_p;

            // Test ToolbarViewModel
            ToolbarViewModel toolbar_view_model = new ToolbarViewModel();

            toolbar_view_model.Title            = "Add Transaction";
            toolbar_view_model.Background_Color = Brushes.Blue;
            toolbar_view_model.Font_Color       = Brushes.White;
            toolbar_view_model.Naigation_btn    = GUIUtilites.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click, 56, 56, 24, 24, Brushes.Transparent, Brushes.Transparent, HorizontalAlignment.Center, VerticalAlignment.Center);

            ToolbarController_m.UpdateViews(toolbar_view_model);

            // Test WorkspaceViewModel
            WorkspaceViewModel workspacce_view_modle = new WorkspaceViewModel();

            WorkspaceController_m.UpdateViews(workspacce_view_modle);
        }
示例#17
0
        public MainWindow()
        {
            InitializeComponent();

            // Setup Toolbar Controller
            toolbar_controller_m = new ToolbarController();
            toolbar_controller_m.AddView(MainToolbar);

            // Test ToolbarViewModel
            ToolbarViewModel toolbar_view_model = new ToolbarViewModel();

            toolbar_view_model.Title            = "Testing Title";
            toolbar_view_model.Background_Color = Brushes.Blue;
            toolbar_view_model.Font_Color       = Brushes.White;
            toolbar_view_model.Naigation_btn    = toolbar_view_model.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click);

            toolbar_controller_m.UpdateViews(toolbar_view_model);

            // Add Item Modifer Buttons
            //tool_bar_view_model.ItemModifers.Add(tool_bar_view_model.BuildImageButton("../images/DeleteWhite.png", DeleteBtn_Click));
            //tool_bar_view_model.ItemModifers.Add(tool_bar_view_model.BuildImageButton("../images/EditWhite.png", EditBtn_Click));
        }
示例#18
0
        /// <summary>
        /// Performs the initial setup of the ToolbarExtensionManager.  This method
        /// must be called once before the Instance property can be used.
        /// </summary>
        /// <param name="_parentToolbar"></param>
        /// <param name="_scope"></param>
        public static void InitialSetup(ToolbarViewModel _parentToolbar, string _scope)
        {
            // Validate parameters
            if (_parentToolbar == null)
            {
                throw new System.ArgumentNullException("_parentToolPanel", "An invalid ToolPanelViewModel was provided");
            }

            if (string.IsNullOrEmpty(_scope))
            {
                throw new System.ArgumentNullException("_scope", "An invalid scope was provided");
            }

            lock (syncRoot)
            {
                // Ensure that this can only be called once
                if (instance == null)
                {
                    instance = new ToolbarExtensionManager(_parentToolbar, _scope);
                    ExtensionManager.ComposeParts(instance);
                }
            }
        }
示例#19
0
 /// <summary>
 /// Create a new instance of the ToolbarExtensionManager.  This class is
 /// private and will be called internally by the InitialSetup method.
 /// </summary>
 /// <param name="_parentToolbar">The viewmodel for the toolbar being managed</param>
 /// <param name="_scope">The scope of the data that the tool bar items will have
 /// access too</param>
 private ToolbarExtensionManager(ToolbarViewModel _parentToolbar, string _scope)
 {
     this.parentToolbar = _parentToolbar;
     this.scope         = _scope;
 }
示例#20
0
 public void Setup()
 {
     toolbar = new ToolbarViewModel();
 }
示例#21
0
 /// <summary>
 /// Provides a deterministic way to delete the ToolbarVMStatic property
 /// </summary>
 public static void ClearToolbarVM()
 {
     toolbarVM.Cleanup();
     toolbarVM = null;
 }
示例#22
0
 public ToolbarView()
 {
     InitializeComponent();
     DataContext = new ToolbarViewModel();
 }
示例#23
0
 public ToolbarView(WorkspaceViewModel workspaceViewModel)
 {
     this.ToolbarViewModel = new ToolbarViewModel(workspaceViewModel);
     this.DataContext      = this.ToolbarViewModel;
     InitializeComponent();
 }
示例#24
0
        protected override void OnStartup(StartupEventArgs eventArgs)
        {
            base.OnStartup(eventArgs);

            TelemetryService.Initialize();
            TelemetryService.PublishUsage(Environment.MachineName, GetAppAssemblyVersion(), "OnStartup", Phase.Start);

            log4net.Config.XmlConfigurator.Configure();

            Uri uri = new Uri("_Resources/Icons.xaml", UriKind.Relative);
            ResourceDictionary dict = new ResourceDictionary {
                Source = uri
            };

            var mainView       = new MainView();
            var messageService = new MessageService(mainView);

            _appInstaller = new Installer(messageService);

            var toolbar         = new ToolbarViewModel();
            var profileManager  = new UserProfileManager();
            var activityManager = new InactiveTransactionsManager();
            var categoriesMap   = new CategoriesViewModel();
            var dataLoader      = new DataLoader(profileManager);

            var dateStateVm   = new DateStateViewModel();
            var auditor       = new Auditor(dataLoader, dateStateVm);
            var newAccountVm  = new NewAccountViewModel(dataLoader);
            var newCategoryVm = new NewCategoryViewModel();

            var accountsVm = new AccountsViewModel(dataLoader, auditor, dateStateVm);
            var incomeVm   = new IncomeViewModel(dataLoader, auditor, dateStateVm);
            var expensesVm = new ExpensesViewModel(dataLoader, auditor, dateStateVm, categoriesMap);
            var budgetVm   = new BudgetViewModel(dataLoader, auditor, dateStateVm, categoriesMap);

            var analysisVm = new AnalysisViewModel();
            var settingsVm = new SettingsViewModel();
            var mainVm     = new MainViewModel(dataLoader, toolbar, accountsVm, newAccountVm, newCategoryVm, budgetVm, dateStateVm);

            toolbar.Items.Add(new ToolboxItemViewModel("Accounts", dict["appbar_layer"] as Canvas, accountsVm, mainVm, true));
            toolbar.Items.Add(new ToolboxItemViewModel("Income", dict["appbar_graph_line_up"] as Canvas, incomeVm, mainVm));
            toolbar.Items.Add(new ToolboxItemViewModel("Expenses", dict["appbar_graph_line_down"] as Canvas, expensesVm, mainVm));
            toolbar.Items.Add(new ToolboxItemViewModel("Budget", dict["appbar_billing"] as Canvas, budgetVm, mainVm));
            toolbar.Items.Add(new ToolboxItemViewModel("Analysis", dict["appbar_graph_bar"] as Canvas, analysisVm, mainVm));
            toolbar.Items.Add(new ToolboxItemViewModel("Settings", dict["appbar_settings"] as Canvas, settingsVm, mainVm));

            mainView.DataContext = mainVm;
            mainView.Show();
            mainView.Closing += (s, e) =>
            {
                mainVm.Dispose();
                accountsVm.Dispose();
                expensesVm.Dispose();
                activityManager.Dispose();

                TelemetryService.PublishUsage(Environment.MachineName, GetAppAssemblyVersion(), "Closing", Phase.End);
            };

            dataLoader.LoadAsync();

            TelemetryService.PublishUsage(Environment.MachineName, GetAppAssemblyVersion(), "OnStartup", Phase.End);
        }