public MsgViewModel()
        {
            PreWidth       = 270;
            apiManager     = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
            stringResource = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);

            Msgs            = new ObservableCollection <Msg>();
            MsgDetails      = new ObservableCollection <MsgDetail>();
            Friends         = new ObservableCollection <RelFriend>();
            SearchedFriends = new ObservableCollection <RelFriend>();
            ApplyFriends    = new ObservableCollection <RelFriend>();

            ApplyFriendCommand       = new RelayCommand(ApplyFriend);
            UpdateFriendCommand      = new RelayCommand(UpdateFriend);
            SendCommand              = new RelayCommand(Send);
            UpdateMsgCommand         = new RelayCommand(UpdateMsg);
            LoadMsgCommand           = new RelayCommand(LoadMsg);
            NextMsgPageCommand       = new RelayCommand(NextMsgPage);
            PrevMsgPageCommand       = new RelayCommand(PrevMsgPage);
            DeleteMsgCommand         = new RelayCommand(DeleteMsg);
            PrevMsgDetailPageCommand = new RelayCommand(PrevMsgDetailPage);
            NextMsgDetailPageCommand = new RelayCommand(NextMsgDetailPage);
            ApplyFriendCommand       = new RelayCommand(ApplyFriend);
            ApplyPageNextCommand     = new RelayCommand(ApplyPageNext);
            ApplyPagePrevCommand     = new RelayCommand(ApplyPagePrev);
            MsgTitle = stringResource.GetString("MsgTitleNull");
        }
        public void Setup()
        {
            _sendEmailServiceMock = new MockContext<ISendEmailService> ();

            _stringResource = new StringResourceMock();
            _sendEmailService = new SendEmailServiceMock (_sendEmailServiceMock);

            _service = new EvaluationService (_stringResource, _sendEmailService);
        }
        public SendContentViewModel()
        {
            apiManager     = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
            stringResource = ViewModelLocatorBase.StringResources;

            SendFiles         = new ObservableCollection <ApiFileModel>();
            SendCommand       = new RelayCommand(Send);
            CleanFilesCommand = new RelayCommand(CleanFiles);

            Lable = string.Empty;
        }
 public MainViewModel()
 {
     IocHelper.EnsureIocKey(this);
     stringResource = ViewModelLocatorBase.StringResources;
     ViewItems      = new ObservableCollection <ViewItem>
     {
         new ViewItem(stringResource.GetString("HomeText"), (char)0xE10F, string.Empty, HomePageId),
         new ViewItem(stringResource.GetString("ContentText"), (char)0xE132, string.Empty, ContentPageId),
         new ViewItem(stringResource.GetString("MakeContentTitle"), (char)0xE11F, string.Empty, SendContentPageId),
         new ViewItem(stringResource.GetString("MsgPageText"), (char)0xE119, string.Empty, MsgPageId),
     };
     //注册消息服务
     MsgHandle.Add(ShowMsgKey, ShowMsgHandle);
 }
Exemple #5
0
        public HomeViewModel()
        {
            apiManager    = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
            accountHelper = SimpleIoc.Inst.GetInstance <ISettingHelper>(ViewModelLocatorBase.AccountSettingKey);
            appResources  = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);
            UserName      = accountHelper.GetValue <string>(UserNameKey);
            Pwd           = accountHelper.GetValue <string>(PwdKey);
            LoginCommand  = new RelayCommand(Login);
            LogOffCommand = new RelayCommand(LogOff);
            IocHelper.EnsureIocKey(this);
#if DEBUG
            UserName = "******";
            Pwd      = "Asdfg123456";
#endif
        }
Exemple #6
0
 public ContentViewModel()
 {
     LocalPage            = 0;
     IsNotWebConnecting   = false;
     ParWidth             = _ParWidth;
     apiManager           = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
     appResources         = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);
     Contents             = new ObservableCollection <Content>();
     IsNotWebConnecting   = true;
     UpdateContentCommand = new RelayCommand(UpdateContent);
     SearchContentCommand = new RelayCommand(SearchContent);
     NextPageCommand      = new RelayCommand(NextPage);
     PrevPageCommand      = new RelayCommand(PrevPage);
     IocHelper.EnsureIocKey(this);
     MsgHandle.Add(SetVisitContentKey, SetVisitContent);
     MsgHandle.Add(SetLeftPartVisibilityKey, SetLeftPartVisibility);
 }
 public ContentDetailViewModel()
 {
     IocHelper.EnsureIocKey(this);
     apiManager             = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
     appResources           = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);
     ContentStack           = new Stack <Content>();
     Comments               = new ObservableCollection <RelComment>();
     GoBackCommand          = new RelayCommand(GoBack);
     UpdateCommentCommand   = new RelayCommand(UpdateComment);
     PrevPageCommand        = new RelayCommand(PrevPage);
     NextPageCommand        = new RelayCommand(NextPage);
     SendCommentCommand     = new RelayCommand(SendComment);
     NavToCommentCommand    = new RelayCommand(NavToComment);
     GoBackToContentCommand = new RelayCommand(GoBackToContent);
     HasPrev   = false;
     PreSymbol = (char)0xE112;
 }
Exemple #8
0
 public MsgView()
 {
     this.InitializeComponent();
     stringResource = ViewModelLocatorBase.StringResources;
     msgCmdHelper   = SimpleIoc.Inst.GetInstance <MsgCmdHelper>(MsgCmdHelper.Key);
 }
 public EvaluationService(IStringResource resource, ISendEmailService sendEmailService)
 {
     _resource = resource;
     _sendEmailService = sendEmailService;
 }