/// <summary> /// Вызывается при построении макета. /// </summary> protected override void OnApplyTemplate() { base.OnApplyTemplate(); MenuPanel = GetTemplateChild(MenuPanelName) as UIElement; LeftManipulationBorder = GetTemplateChild(LeftManipulationBorderName) as UIElement; MenuBtn = GetTemplateChild(MenuButtonName) as UIElement; DimmingRect = GetTemplateChild(DimmingRectName) as UIElement; MenuList = GetTemplateChild(MenuListName) as NavMenuListView; TopBarButtonPanel = GetTemplateChild(TopBarButtonsPanelName) as Panel; CommandBarPanel = GetTemplateChild(CommandBarPanelName) as Panel; FinalizeTranslate = GetTemplateChild(FinalaizeTranslateName) as Storyboard; NotificationsPanel = GetTemplateChild(NotificationsPanelName) as Panel; MenuList.ItemsSource = navlist; if (Content != null) { VisibilityState = GetIsVisible(Content as DependencyObject); PageTitle = GetTitle(Content as DependencyObject); UpdateTopBarButtons(GetTopBarButtons(Content as DependencyObject)); UpdateOneCommandBar(GetCommandBar(Content as DependencyObject)); } if (!ViewModelBase.IsInDesignModeStatic) { _settings = ServiceHelper.SettingsService; navigationService = ((App)Application.Current).Container.Resolve <INavigationService>(); SubscribeToEvents(); if (WaitingNotifications.Count > 0) { foreach (var notification in WaitingNotifications) { ShowNotification(notification); } WaitingNotifications.Clear(); } } }
public SettingsViewModelDesignTime() { _settingsSertvice = new Service.SettingsService(new RepositoryJsonSettings()); Settings = _settingsSertvice.GetSettings(); }