//internal ListView markedList;
 ////private bool _contentLoaded;
 public MarkedRecordPage()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.markedList.Items.Clear();
     this.groups = this.dataService.GetEntGroupList();
 }
Ejemplo n.º 2
0
 //internal Border OuterBorder;
 //internal Border InnerBorder;
 //internal StatusBar topBar;
 //internal Image imgIcon;
 //internal ImageButton btnMin;
 //internal ImageButton btnClose;
 //internal TextBox txtName;
 //internal TextBox txtDescription;
 //internal ListBox lstMember;
 //internal Button btnSelect;
 //internal Button btnRemove;
 //internal ComboBox cboCategory;
 //internal ListBox lstStaff;
 //internal Button btnAddAll;
 //internal Button btnRemoveAll;
 //internal Button btnEnter;
 //internal Button btnCancel;
 //private bool _contentLoaded;
 public EntGroupManagerWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.InitData();
     base.Closed += new System.EventHandler(this.EntGroupManagerWindow_Closed);
 }
Ejemplo n.º 3
0
 public EntGroupManagerWindow(EntGroup group)
 {
     if (group != null)
     {
         ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
         this.InitializeComponent();
         this.group               = group;
         this.txtName.Text        = group.Name;
         this.txtDescription.Text = group.Description;
         long[] memebers = this.group.Member;
         if (memebers != null && memebers.Length > 0)
         {
             long[] array = memebers;
             for (int i = 0; i < array.Length; i++)
             {
                 long  member = array[i];
                 Staff staff  = this.dataService.GetStaff(member);
                 if (staff != null)
                 {
                     this.AddListMemberItem(staff);
                 }
             }
         }
         this.InitData();
     }
     base.Closed += new System.EventHandler(this.EntGroupManagerWindow_Closed);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 启动
        /// </summary>
        /// <param name="e"></param>
        protected override async void OnStartup(StartupEventArgs e)
        {
            this.DispatcherUnhandledException          += App_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            System.Threading.Tasks.TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;

            //设置当前程序集
            this.ShutdownMode = ShutdownMode.OnMainWindowClose;
            //初始化当前程序集样式
            ThemeSwitcher.SetTheme(ThemeEnum.METRO);
            //初始化程序
            PluginHelper.LoadApplication();
            //创建入口程序对象

            var launcher = PluginHelper.CreateInstanceByKey("Launcher");

            if (launcher != null)
            {
                await Task.Factory.StartNew(() =>
                {
                    this.Dispatcher.Invoke(new Action(() =>
                    {
                        launcher.Run();
                    }));
                });

                base.OnStartup(e);
                return;
            }

            System.Environment.Exit(System.Environment.ExitCode);
        }
 private SettingEmailAccountWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.InitialEmail();
     this.AddListenerEvent();
 }
Ejemplo n.º 6
0
 //internal SearchRosterWindow searchRosterWindow;
 //internal Border OuterBorder;
 //internal Border InnerBorder;
 //internal StatusBar topBar;
 //internal Image imgIcon;
 //internal ImageButton btnMin;
 //internal ImageButton btnClose;
 //internal TabControl tab;
 //internal TabItem tabItem1;
 //internal RadioButton rbtByin;
 //internal RadioButton rbtByCondition;
 //internal TextBlock tbkInid;
 //internal TextBox tbxInid;
 //internal Canvas conditionCanvas;
 //internal ComboBox comboBox1;
 //internal TextBox comboBox2;
 //internal TextBox textBox1;
 //internal ComboBox comboBox3;
 //internal TextBox textBox2;
 //internal TextBox textBox3;
 //internal ComboBox comboBox4;
 //internal ComboBox textBox4;
 //internal ComboBox textBox5;
 //internal TabItem tabItem2;
 //internal TabItem tabItem3;
 //internal Button btnSearch;
 //internal Button btnCancel;
 //private bool _contentLoaded;
 public SearchRosterWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.InitUI();
     this.AddEventListener();
 }
 //private bool _contentLoaded;
 public SystemSettingWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.InitData();
     this.AddEventListenerHandler();
     this.rdoBasic.IsChecked = new bool?(true);
 }
 public MessageCenterWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.InitEventHandler();
     this.messageCenter = new MessageCenterViewModel();
     this.groups        = this.dataService.GetEntGroupList();
 }
Ejemplo n.º 9
0
 //internal ClosingTipWindow closingTipWindow;
 //internal Border OuterBorder;
 //internal Border InnerBorder;
 //internal Grid RootGrid;
 //internal StatusBar topBar;
 //internal Image imgIcon;
 //internal ImageButton btnClose;
 //internal RadioButton rboHide;
 //internal RadioButton rboExit;
 //internal CheckBox chkExitRemind;
 //private bool _contentLoaded;
 public ClosingTipWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.rboHide.IsChecked       = new bool?(Settings.Default.SystemSetup_Base_ExitHide);
     this.rboExit.IsChecked       = new bool?(!Settings.Default.SystemSetup_Base_ExitHide);
     this.chkExitRemind.IsChecked = new bool?(Settings.Default.ExitRemind);
 }
Ejemplo n.º 10
0
        public Settings()
        {
            this.InitializeComponent();
            ThemeSwitcher themeSwitcher = new ThemeSwitcher();

            themeSwitcherUI.DataContext = themeSwitcher;
            LanguageSwitcher languageSwitcher = new LanguageSwitcher();

            languageSwitcherUI.DataContext = languageSwitcher;
        }
Ejemplo n.º 11
0
    private void BindData()
    {
        var currentTheme = ThemeSwitcher.GetCurrentTheme();

        foreach (var theme in ThemeSwitcher.ListThemes())
        {
            var item = new ListItem(theme);
            item.Selected = theme == currentTheme;
            ddlThemes.Items.Add(item);
        }
    }
        public ThemeSwitcherTests()
        {
            const string AssetKey = "themeSwitcher";

            _httpContext = TestHelper.CreateMockedHttpContext();
            _viewContext = new ViewContext { HttpContext = _httpContext.Object, ViewData = new ViewDataDictionary() };

            _clientSideObjectWriterFactory = new Mock<IClientSideObjectWriterFactory>();

            _themeSwitcher = new ThemeSwitcher(_viewContext, _clientSideObjectWriterFactory.Object) { AssetKey = AssetKey };
        }
Ejemplo n.º 13
0
 //internal TextBlock titleName;
 //internal FlowDocumentScrollViewer ViewMessageBoxViewer;
 //internal FlowDocument ViewMessageBox;
 //internal TableRowGroup trgMessageTable;
 //internal DatePicker DateSelect;
 //internal Button FirstPage;
 //internal Button PrePage;
 //internal TextBox textPage;
 //internal TextBlock tbkTotal;
 //internal Button NextPage;
 //internal Button LastPage;
 ////private bool _contentLoaded;
 public MsgRecordPage()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.ID           = 0L;
     this.IsMark       = false;
     this.IsStaff      = false;
     this.TotalRecord  = 0;
     this.Showpage     = 0;
     this.TotalPage    = 0;
     this.IsDataSearch = false;
 }
Ejemplo n.º 14
0
 //internal FlowDocumentScrollViewer ViewMessageBoxViewer;
 //internal FlowDocument ViewMessageBox;
 //internal TableRowGroup trgMessageTable;
 //internal DatePicker DateSelect;
 //internal Button FirstPage;
 //internal Button PrePage;
 //internal TextBox textPage;
 //internal TextBlock tbkTotal;
 //internal Button NextPage;
 //internal Button LastPage;
 ////private bool _contentLoaded;
 public OANoticeRecordPage()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.ShowPage      = 1;
     this.MaxPage       = 0;
     this.startTime     = null;
     this.endTime       = null;
     this.textPage.Text = this.ShowPage.ToString();
     this.tbkTotal.Text = "页/" + this.MaxPage.ToString() + "页";
     this.messageCenter = new MessageCenterViewModel();
 }
Ejemplo n.º 15
0
 //internal Border OuterBorder;
 //internal Border InnerBorder;
 //internal Image imgIcon;
 //internal MinButton btnMin;
 //internal CloseButton btnClose;
 //internal TextBlock tbRequesterName;
 //internal TextBlock tbkId;
 //internal TextBlock tbkSex;
 //internal TextBlock tbkAge;
 //internal TextBlock tbkAddress;
 //internal TextBlock tbkPost;
 //internal Button btnViewInfo;
 //internal RadioButton radioButton1;
 //internal RadioButton radioButton2;
 //internal RadioButton radioButton3;
 //internal TextBox tbMessage;
 //internal Button btnAgree;
 //internal Button btnForget;
 //private bool _contentLoaded;
 public FriendRequestWindow(long uid, long rosterId, string rosterJid, string message, User user, long categotyId)
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.uid        = uid;
     this.rosterId   = rosterId;
     this.rosterJid  = rosterJid;
     this.message    = message;
     this.user       = user;
     this.categotyId = categotyId;
     this.InitUI();
     this.AddEventListener();
 }
Ejemplo n.º 16
0
        public PinViewModel(INavigationService navigationService,
                            ThemeSwitcher themeSwitcher,
                            ICommandResolver commandResolver)
            : base(navigationService)
        {
            _pinBuilder    = new StringBuilder();
            _themeSwitcher = themeSwitcher;
            Message        = Resmgr.Value.GetString(ConstantsHelper.EnterPin, CultureInfo.CurrentCulture);

            DeleteNumberCommand = commandResolver.CommandWithoutLock(DeletePinNumber);
            PinCommand          = commandResolver.AsyncCommandWithoutLock <string>(CheckPinAsync);

            InitializeImagesForButtons();
        }
 //internal Border OuterBorder;
 //internal Border InnerBorder;
 //internal StatusBar topBar;
 //internal Image imgIcon;
 //internal ImageButton btnMin;
 //internal ComboBox cboxDeptList;
 //internal ListBox lstBoxFrom;
 //internal Label label2;
 //internal ListBox lstBoxTo;
 //internal TextBlock lblDeleteAll;
 //internal TextBlock lblAddAll;
 //internal Button btnOk;
 //internal Button btnClose;
 //private bool _contentLoaded;
 public AddMemberCustomGroupWindow(string groupid)
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.groupId   = groupid;
     this.viewModel = CustomGroupManagerWindowViewModel.GetInstance();
     this.cboxDeptList.SelectionChanged += new SelectionChangedEventHandler(this.cboxDeptList_SelectionChanged);
     this.InitialDeptList();
     this.btnClose.Click += delegate(object s, RoutedEventArgs e)
     {
         base.Close();
     };
     this.InitialToBox(groupid);
 }
Ejemplo n.º 18
0
        public App()
        {
            InitializeComponent();

            Bootstrapper.RegisterServices();
            InitRepositories();

            _navigationService  = ComponentFactory.Resolve <INavigationService>();
            _themeSwitchService = ComponentFactory.Resolve <ThemeSwitcher>();
            _themeService       = ComponentFactory.Resolve <IThemeService>();

            bool.TryParse(Settings.UsePin, out var shouldUsePin);
            InitNavigation(shouldUsePin);
        }
        public LoginViewModel(INavigationService navigationService,
                              ThemeSwitcher themeSwitcher,
                              ICommandResolver commandResolver)
            : base(navigationService)
        {
            TogglePasswordImageSource = themeSwitcher.CurrentThemeType == ThemeTypes.Dark
                        ? ConstantsHelper.TogglePasswordLightImage
                        : ConstantsHelper.TogglePasswordDarkImage;

            SignInCommand = commandResolver.AsyncCommand(SignIn);
            SwitchPasswordVisibilityCommand        = commandResolver.Command(SwitchPasswordVisibility);
            ToggleRegisterOrLoginViewCommand       = commandResolver.Command(ToggleRegisterOrLoginView);
            SwitchPasswordConfirmVisibilityCommand = commandResolver.Command(SwitchConfirmPasswordVisibility);
        }
Ejemplo n.º 20
0
 public LogonWindow()
 {
     try
     {
         ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
         this.InitializeComponent();
         this.AddEventListenerHandler();
     }
     catch (System.Exception e)
     {
         if (this.logger != null)
         {
             this.logger.Error(e.ToString());
         }
     }
 }
Ejemplo n.º 21
0
 //internal UserHeaderWindow userHeaderWindow;
 //internal Border OuterBorder;
 //internal Border InnerBorder;
 //internal StatusBar topBar;
 //internal ImageButton btnMin;
 //internal ImageButton btnClose;
 //internal Border leftMenuBorder;
 //internal System.Windows.Controls.Image img40;
 //internal System.Windows.Controls.Image img110;
 //internal Button btnSelectFile;
 //internal Canvas ImageBox;
 //internal System.Windows.Controls.Image img;
 //internal System.Windows.Shapes.Rectangle rectangleBox;
 //private bool _contentLoaded;
 public UserHeaderWindow(Staff staff)
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.InitUI();
     this.imageCanvas.Width      = 200.0;
     this.imageCanvas.Height     = 200.0;
     this.imageCanvas.Visibility = Visibility.Hidden;
     this.imageCanvas.CacheImage = new CanvasCustom.CacheImageDelegate(this.CacheImageHandler);
     this.ImageBox.Children.Add(this.imageCanvas);
     this.size          = (int)this.ImageBox.Height;
     this.img40.Source  = staff.HeaderImage;
     this.img110.Source = staff.HeaderImage;
     this.img.Width     = (double)this.size;
     this.img.Height    = (double)this.size;
     this.img.Source    = staff.HeaderImage;
 }
Ejemplo n.º 22
0
 public UpdateWindow()
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     if (ApplicationDeployment.IsNetworkDeployed || this.debug)
     {
         this.lblVer.Text = "当前版本:" + AppUtil.Instance.AppVersion();
     }
     else
     {
         this.lblMsg.Text = "内部开发版禁止更新!";
         this.lblVer.Text = "当前版本:内部开发版";
         this.btnCheckUpdate.IsEnabled = false;
         this.btnCheckUpdate.Content   = "禁止更新";
     }
     this.sessionService = ServiceUtil.Instance.SessionService;
     this.fileService    = ServiceUtil.Instance.FileService;
     this.logger         = ServiceUtil.Instance.Logger;
 }
Ejemplo n.º 23
0
        public MenuMasterViewModel(INavigationService navigationService,
                                   ThemeSwitcher themeSwitcher,
                                   ICommandResolver commandResolver)
            : base(navigationService)
        {
            _themeSwitcher = themeSwitcher;

            MessagingCenter.Subscribe <UserProfileViewModel>(this,
                                                             ConstantsHelper.ProfileUpdated,
                                                             vm => UpdateProfile());
            MessagingCenter.Subscribe <ThemeSwitcher>(this,
                                                      ConstantsHelper.AppThemeChanged,
                                                      ts => DrawMenu());

            UpdateProfile();
            DrawMenu();

            NavigateToUserProfileCommand = commandResolver.AsyncCommand(NavigateToUserProfile);
            ChangeDetailsPageCommand     = commandResolver.AsyncCommand <MenuViewIndex>(ChangeDetailsPageAsync);
            LogoutCommand = commandResolver.AsyncCommand(Logout);
        }
Ejemplo n.º 24
0
        public void InitializeModule()
        {
            themeSwitcher = new ThemeSwitcher(themeResourcePattern,
                                              new[] { typeof(Rect), typeof(Brush), typeof(Style), typeof(DataTemplate), typeof(ShaderEffect) }, true);

            var defaultThemes = new List <string>()
            {
                "/ClearMine.Themes;component/Themes/Generic.xaml"
            };

            if (SwitchThemeMessage.CustomThemeKey.Equals(Settings.Default.CurrentTheme, StringComparison.Ordinal))
            {
                defaultThemes.Add(Settings.Default.CustomThemeFile);
            }
            else
            {
                defaultThemes.Add(String.Format(themeResourcePattern, Settings.Default.CurrentTheme));
            }
            themeSwitcher.DefaultThemes = defaultThemes;
            MessageManager.SubscribeMessage <UIComponentLoadedMessage>(OnUIComponentLoaded);
        }
Ejemplo n.º 25
0
        public SettingsViewModel(INavigationService navigationService,
                                 ThemeSwitcher themeSwitcher,
                                 IThemeService themeService,
                                 ICommandResolver commandResolver)
            : base(navigationService)
        {
            _themeService  = themeService;
            _themeSwitcher = themeSwitcher;

            _savedTheme = (ThemeTypes)Enum.Parse(typeof(ThemeTypes), Settings.ThemeType);

            bool.TryParse(Settings.UsePin, out bool shouldUsePin);
            UsePin = shouldUsePin;

            if ((ThemeTypes)Enum.Parse(typeof(ThemeTypes), Settings.ThemeType) == ThemeTypes.Dark)
            {
                IsDarkTheme = true;
            }
            SaveSettingsCommand = commandResolver.Command <string>(pin => SaveSettings(pin));
            OpenPinViewCommand  = commandResolver.AsyncCommand(OpenPinViewAsync);
        }
        public SettingsViewModel(
            INavigationService navigationService,
            IFileSystem fileService,
            IMediaService mediaService,
            ThemeSwitcher themeSwitcher,
            IThemeService themeService,
            IPlatformDocumentPicker documentPicker,
            ICommandResolver commandResolver)
            : base(navigationService)
        {
            _fileService    = fileService;
            _mediaService   = mediaService;
            _themeService   = themeService;
            _themeSwitcher  = themeSwitcher;
            _documentPicker = documentPicker;

            _savedTheme = (ThemeTypes)Enum.Parse(typeof(ThemeTypes), Settings.ThemeType);

            bool.TryParse(Settings.UsePin, out bool shouldUsePin);
            UsePin = shouldUsePin;

            if ((ThemeTypes)Enum.Parse(typeof(ThemeTypes), Settings.ThemeType) == ThemeTypes.Dark)
            {
                IsDarkTheme = true;
            }

            bool.TryParse(Settings.UsePinBackground, out bool shouldUsePinBackground);
            UsePinPageBackground = shouldUsePinBackground;

            if (UsePinPageBackground)
            {
                PinBackgroundImagePath = Settings.PinBackground;
            }

            SaveSettingsCommand            = commandResolver.Command(SaveSettings);
            OpenPinViewCommand             = commandResolver.AsyncCommand(OpenPinViewAsync);
            ChangePinViewBackgroundCommand = commandResolver.AsyncCommand(ChangePinBackground);
            ResetPinBackgroundCommand      = commandResolver.Command(ResetPinBackground);
        }
Ejemplo n.º 27
0
        public PinViewModel(INavigationService navigationService,
                            ThemeSwitcher themeSwitcher,
                            ICommandResolver commandResolver)
            : base(navigationService)
        {
            _pinBuilder    = new StringBuilder();
            _themeSwitcher = themeSwitcher;
            Message        = Resmgr.Value.GetString(ConstantsHelper.EnterPin, CultureInfo.CurrentCulture);

            DeleteNumberCommand = commandResolver.CommandWithoutLock(DeletePinNumber);
            PinCommand          = commandResolver.AsyncCommandWithoutLock <string>(CheckPinAsync);

            InitializeImagesForButtons();

            bool.TryParse(Settings.UsePinBackground, out bool shouldUsePinBackground);
            UsePinPageBackground = shouldUsePinBackground;

            if (UsePinPageBackground)
            {
                PinBackgroundImagePath = Settings.PinBackground;
            }
        }
Ejemplo n.º 28
0
 private void Dark_Theme_Button_Checked(object sender, RoutedEventArgs e)
 {
     ThemeSwitcher.Switch("Dark", true, this);
 }
 public MainWindow()
 {
     InitializeComponent();
     ThemeSwitcher = new ThemeSwitcher(this);
 }
 public ThemeSwitcherBuilderTests()
 {
     _themeSwitcher = new ThemeSwitcher(new ViewContext(), new Mock<IClientSideObjectWriterFactory>().Object);
     _builder = new ThemeSwitcherBuilder(_themeSwitcher);
 }
Ejemplo n.º 31
0
 private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
 {
     ThemeSwitcher.ToggleTheme();
 }
Ejemplo n.º 32
0
 protected void ddlThemes_SelectedIndexChanged(object sender, EventArgs e)
 {
     ThemeSwitcher.SaveCurrentTheme(ddlThemes.SelectedItem.Value);
     Response.Redirect("~/default.aspx");
 }