Ejemplo n.º 1
0
        public void LoadDatas()
        {
            this.Items.Clear();

            if (AppData.MainMV.IsAdmin)
            {
                SettingModel modelCommon = new SettingModel();
                modelCommon.Name        = "公共快捷回复设置";
                modelCommon.SettingType = SettingType.FastReply;
                modelCommon.IsChecked   = true;

                SettingViewModel vmCommon = new SettingViewModel(modelCommon);
                vmCommon.View = new SetFastReply(new FastReplyViewModel(new FastReplyModel(), true));
                this.Items.Add(vmCommon);
                this.SelectedItem = vmCommon;

                SettingModel modelPersonal = new SettingModel();
                modelPersonal.Name        = "个人快捷回复设置";
                modelPersonal.SettingType = SettingType.FastReply;
                SettingViewModel vmPersonal = new SettingViewModel(modelPersonal);
                vmPersonal.View = new SetFastReply(new FastReplyViewModel(new FastReplyModel(), false));
                this.Items.Add(vmPersonal);
            }
            else
            {
                SettingModel modelCommon = new SettingModel();
                modelCommon.Name        = "公共快捷回复设置";
                modelCommon.SettingType = SettingType.FastReply;
                SettingViewModel vmCommon = new SettingViewModel(modelCommon);
                vmCommon.View = new SetFastReply(new FastReplyViewModel(new FastReplyModel(), true));

                SettingModel modelPersonal = new SettingModel();
                modelPersonal.Name        = "个人快捷回复设置";
                modelPersonal.SettingType = SettingType.FastReply;
                SettingViewModel vmPersonal = new SettingViewModel(modelPersonal);
                vmPersonal.View = new SetFastReply(new FastReplyViewModel(new FastReplyModel(), false));
                this.Items.Add(vmPersonal);

                this.SelectedItem = vmPersonal;
            }
        }