public AdminNavigationControl(MainPage mainPage) { // Required to initialize variables InitializeComponent(); mMainPage = mainPage; Loaded += (s1, e1) => SetSplitterWidth(mMainPage); if (CMS.EffectivePrivileges.AdminTab.CanViewConfig || CMS.EffectivePrivileges.AdminTab.CanModifyConfig) { AdminConfigControl configControl = new AdminConfigControl(); configControl.ReloadRequired += configControl_ReloadRequired; ConfigControl.Content = configControl; } int allUsers = (from u in CMS.Cache.Users select u).Count(); int activeUsers = (from u in CMS.Cache.ActiveUsers select u).Count(); EquipmentSummaryViewModel activeModel = new EquipmentSummaryViewModel("Active Users", activeUsers); ActiveUsersTotalControl.DataContext = activeModel; EquipmentSummaryViewModel inActiveModel = new EquipmentSummaryViewModel("Inactive Users", (allUsers - activeUsers)); InactiveUsersTotalControl.DataContext = inActiveModel; }
private static void SetSplitterWidth(MainPage mainPage) { GridLength gl = new GridLength(CMS.User.UserPreference.AdminPanelWidth); mainPage.NavigationPanelWidth.Width = gl; }