public NavigationPartViewModel(ShellViewModel monitorLayoutShellViewModel) { var properties = new List<string>() { "NavigationItems", "MinimizeCommand", "TextVisibility", }; _shellViewModel = monitorLayoutShellViewModel; _shellViewModel.PropertyChanged += (s, e) => { if (properties.Contains(e.PropertyName)) OnPropertyChanged(e.PropertyName); }; OnPropertyChanged(() => NavigationItems); }
public static FrameworkElement BuildControl(ShellViewModel model) { model.Header.ShowIconAndTitle = false; model.AllowClose = false; model.AllowHelp = false; model.AllowMaximize = false; model.AllowMinimize = false; model.Width = double.NaN; model.Height = double.NaN; var frameworkElement = new ScrollViewer() { Content = new ContentControl() { Content = model, ContentTemplateSelector = new MulticlientDataTemplateSelector(), MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight - 100, MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth - 100, }, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, }; frameworkElement.SetResourceReference(ScrollViewer.BackgroundProperty, "BaseWindowBackgroundBrush"); return frameworkElement; }
internal LayoutService(ShellViewModel shellViewModel) { ShellViewModel = shellViewModel; ShortcutService = new ShortcutService(); _cache = new Dictionary<string, ContentPresenter>(); }
protected virtual bool Run() { var result = true; ShellViewModel = CreateShell(); ((LayoutService)ServiceFactory.Layout).SetToolbarViewModel((ToolbarViewModel)ShellViewModel.Toolbar); if (!RunShell(ShellViewModel)) result = false; //((LayoutService)ServiceFactory.Layout).AddToolbarItem(new GlobalPimActivationViewModel()); ((LayoutService)ServiceFactory.Layout).AddToolbarItem(new SoundViewModel()); ((LayoutService)ServiceFactory.Layout).AddToolbarItem(new UserViewModel(this)); ((LayoutService)ServiceFactory.Layout).AddToolbarItem(new AutoActivationViewModel()); return result; }
public static void Run(ShellViewModel model) { Shell = model; Layout = new LayoutService(model); if (Starting != null) Starting(Layout, EventArgs.Empty); if (ApplicationController == null) Run((ApplicationViewModel)model, true); else { var frameworkElement = BuildControl(model); Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; ApplicationController(frameworkElement); } }
protected bool RunShell(ShellViewModel shellViewModel) { ApplicationService.RegisterShell(shellViewModel); LoadingService.DoStep("Загрузка модулей приложения"); CreateViewModels(); shellViewModel.NavigationItems = GetNavigationItems(); if (InitializeModules()) { ApplicationService.User = FiresecManager.CurrentUser; LoadingService.DoStep("Запуск приложения"); ApplicationService.Run(shellViewModel); return true; } return false; }
public static void RegisterShell(ShellViewModel shell) { Shell = shell; }
public ContentPartViewModel(ShellViewModel shellViewModel) { _shellViewModel = shellViewModel; }
protected bool RunShell(ShellViewModel shellViewModel) { StartupService.Instance.DoStep("Загрузка модулей приложения"); CreateViewModels(); shellViewModel.NavigationItems = new ReadOnlyCollection<NavigationItem>(GetNavigationItems()); if (InitializeModules()) { ApplicationService.User = ClientManager.CurrentUser; StartupService.Instance.DoStep("Запуск приложения"); ApplicationService.Run(shellViewModel); return true; } return false; }