예제 #1
0
        public MainPageViewModel()
        {
            AdminTabButtonVisibility = Visibility.Collapsed;

            this.mainViewModel = null;
            this.mainPage      = null;

            ContactsTab           = new ContactsTab();
            CreateConversationTab = new CreateConversationTab();
            AdminTab    = new AdminTab();
            SettingsTab = new SettingsTab();

            MessageText = "";
        }
예제 #2
0
        public MainPageViewModel(MainViewModel mainViewModel, MainPage mainPage)
        {
            this.mainViewModel = mainViewModel;
            this.mainPage      = mainPage;
            MessageText        = "";

            AdminTabButtonVisibility = MainViewModel.UserInfo.Info.LawStatus == LawStatus.Admin ? Visibility.Visible : Visibility.Collapsed;

            ContactsTab           = new ContactsTab(this);
            CreateConversationTab = new CreateConversationTab(this);
            AdminTab    = new AdminTab(this);
            SettingsTab = new SettingsTab(this);

            MainPageViewModel.clientListener = new ClientListener(this);

            ContactsTab.TabVisibility = Visibility.Visible;

            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(100);
                Client.ServerRequest(new RRTemplate(RRType.RefreshContacts, new RefreshContactsTemplate(mainViewModel.UserInfo.Info.Id, null)));
            });
        }