コード例 #1
0
		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);
		}
コード例 #2
0
ファイル: ApplicationService.cs プロジェクト: xbadcode/Rubezh
		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;
		}
コード例 #3
0
ファイル: LayoutService.cs プロジェクト: saeednazari/Rubezh
		internal LayoutService(ShellViewModel shellViewModel)
		{
			ShellViewModel = shellViewModel;
			ShortcutService = new ShortcutService();
			_cache = new Dictionary<string, ContentPresenter>();
		}
コード例 #4
0
ファイル: Bootstrapper.cs プロジェクト: xbadcode/Rubezh
		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;
		}
コード例 #5
0
ファイル: ApplicationService.cs プロジェクト: xbadcode/Rubezh
		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);
			}
		}
コード例 #6
0
		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;
		}
コード例 #7
0
		public static void RegisterShell(ShellViewModel shell)
		{
			Shell = shell;
		}
コード例 #8
0
		public ContentPartViewModel(ShellViewModel shellViewModel)
		{
			_shellViewModel = shellViewModel;
		}
コード例 #9
0
ファイル: BaseBootstrapper.cs プロジェクト: xbadcode/Rubezh
		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;
		}