Example #1
0
        /// <summary>Initializes a new instance of the <see cref="MtFrame"/> class. </summary>
        public MtFrame()
        {
#if WINDOWS_UAP
            AutomaticBackButtonHandling = true;
#endif

            HorizontalContentAlignment = HorizontalAlignment.Stretch;
            VerticalContentAlignment = VerticalAlignment.Stretch;

            HorizontalAlignment = HorizontalAlignment.Stretch;
            VerticalAlignment = VerticalAlignment.Stretch;

            Loaded += delegate { Window.Current.VisibilityChanged += OnVisibilityChanged; };
            Unloaded += delegate { Window.Current.VisibilityChanged -= OnVisibilityChanged; };

            GoBackCommand = new RelayCommand(() => GoBackAsync(), () => CanGoBack);

            DefaultStyleKey = typeof(MtFrame);

            if (Device.HasHardwareBackKey)
            {
                DisableForwardStack = true;
                PageAnimation = new TurnstilePageAnimation();
            }
            else
                DisableForwardStack = false;
        }
Example #2
0
 public MainWindowModel()
 {
     UpdateCommand = new AsyncRelayCommand<WikiConfiguration>(GenerateHtmlFilesAsync);
     AddCommand = new RelayCommand(Add);
     RemoveCommand = new RelayCommand<WikiConfiguration>(Remove);
     ApplyCommand = new RelayCommand<WikiConfiguration>(Apply);
 }
 public EditProfileViewModel()
 {
     SaveMainInforamtionCommand = new RelayCommand(() => SaveMainInforamtion());
     SaveAdditionalInforamtionCommand = new RelayCommand(() => SaveAdditionalInforamtion());
     ChangePasswordCommand = new RelayCommand(() => ChangePassword());
     ChangePivotCommand = new RelayCommand<object>((obj) => SelectedChangePivot(obj));
 }
Example #4
0
 public ProfileViewModel()
 {
     ActionWithMessageCommand = new RelayCommand(() => ActionWithMessage());
     EditProfileCommand = new RelayCommand(() => EditProfile());
     ExitProfileCommand = new RelayCommand(() => ExitProfile());
     SearchUsersCommand = new RelayCommand(() => SearchUsers());
 }
        public NewsSectionViewModel()
        {

            PivotOrFlipViewSelectionChange = new RelayCommand<object>((obj) => ChangeNewsSection(obj));
            OpenFullNewsCommandNav = new RelayCommand<object>(async (obj) => await DetailsPage(obj));
            FavoritePageCommand = new RelayCommand(() => FavoritePage());
            UpdateNewsSectionCommand = new RelayCommand(() => UpdateNewsSection());
            AddToDataBaseCommand = new RelayCommand<object>((obj) => AddItemToDataBas(obj));
            ChangeDataTemplateNewsCommand = new RelayCommand(() => ChangeDataTemplateNews());
        }
Example #6
0
        /// <summary>Initializes a new instance of the <see cref="MainWindowModel"/> class.</summary>
        public MainWindowModel()
        {
            CreateDocumentCommand = new RelayCommand(CreateDocument);
            OpenDocumentCommand = new RelayCommand(OpenDocument);

            CloseDocumentCommand = new RelayCommand<NSwagDocument>(document => CloseDocument(document), document => document != null);
            SaveDocumentCommand = new RelayCommand<NSwagDocument>(document => SaveDocument(document), document => document != null);
            SaveAsDocumentCommand = new RelayCommand<NSwagDocument>(document => SaveAsDocument(document), document => document != null);

            Documents = new ObservableCollection<NSwagDocument>();
        }
Example #7
0
        /// <summary>Initializes a new instance of the <see cref="MainWindowModel"/> class.</summary>
        public MainWindowModel()
        {
            CreateDocumentCommand = new RelayCommand(CreateDocument);
            OpenDocumentCommand = new AsyncRelayCommand(OpenDocumentAsync);

            CloseDocumentCommand = new AsyncRelayCommand<DocumentModel>(async document => await CloseDocumentAsync(document), document => document != null);
            SaveDocumentCommand = new AsyncRelayCommand<DocumentModel>(async document => await SaveDocumentAsync(document), document => document != null);
            SaveAsDocumentCommand = new AsyncRelayCommand<DocumentModel>(async document => await SaveAsDocumentAsync(document), document => document != null);

            Documents = new ObservableCollection<DocumentModel>();
        }
Example #8
0
 public SettingViewModel()
 {
     CheckUncheckAutoLoadnewsCommand = new RelayCommand<object>((obj) => CheckUncheckAutoLoadnews(obj));
     ChangedThemeAppCommand = new RelayCommand<object>((obj) => ChangedThemeApp(obj));
     PivotSelectedIndexCommand = new RelayCommand<object>((obj) => PivotSelectedIndexEvent(obj));
     ChangedNumberNewsCacheCommand = new RelayCommand(() => ChangedNumberNewsCache());
     ClearCacheCommand = new RelayCommand(() => CleadCache());
     ChangeTown = new RelayCommand<object>((obj) => SetTownIDWeather(obj));
     CurrentTypeCommand = new RelayCommand<object>((obj) => CurrentTypeChanged(obj));
     BankActionCommand = new RelayCommand<object>((obj) => BankActionChanged(obj));
 }
        public MainWindowModel()
        {
            Documents = new ObservableCollection<JsonDocumentModel>();

            CreateDocumentCommand = new AsyncRelayCommand(CreateDocumentAsync);
            OpenDocumentCommand = new AsyncRelayCommand(OpenDocumentAsync);
            OpenDocumentFromPathCommand = new AsyncRelayCommand<string>(OpenDocumentAsync);
            SaveDocumentCommand = new AsyncRelayCommand<JsonDocumentModel>(SaveDocumentAsync, d => d != null && d.UndoRedoManager.CanUndo);
            SaveDocumentAsCommand = new AsyncRelayCommand<JsonDocumentModel>(SaveDocumentAsAsync, d => d != null);
            SaveDocumentSchemaAsCommand = new AsyncRelayCommand<JsonDocumentModel>(SaveDocumentSchemaAsAsync, d => d != null);
            CloseDocumentCommand = new AsyncRelayCommand<JsonDocumentModel>(CloseDocumentAsync, d => d != null);
            ValidateDocumentCommand = new AsyncRelayCommand<JsonDocumentModel>(ValidateDocumentAsync, d => d != null);

            UndoCommand = new RelayCommand<JsonDocumentModel>(d => d.UndoRedoManager.Undo(), d => d != null && d.UndoRedoManager.CanUndo);
            RedoCommand = new RelayCommand<JsonDocumentModel>(d => d.UndoRedoManager.Redo(), d => d != null && d.UndoRedoManager.CanRedo);
        }
Example #10
0
        public ViewNewsViewModel()
        {
            CommentsAdd = new RelayCommand<object>((obj) => AddComments(obj));
            SendButtonActive = new RelayCommand(() => ActiveSendButton());
            ChangeCommetnsGridVisible = new RelayCommand(() => VisibleCommentsGrid());
            OpenNewsInBrowser = new RelayCommand<object>(async (obj) => await OpenLink(obj));
            SaveNewsInDB = new RelayCommand<object>((obj) => SaveNewsDB(obj));
            UpdateCommentsList = new RelayCommand(async () => await UpdateCommets());
            AnswerCommentCommand = new RelayCommand<object>((obj) => AnswerComment(obj));
            AnswerQuoteCommentCommand = new RelayCommand<object>((obj) => AnswerQuoteComment(obj));
            LikeCommentsCommand = new RelayCommand<object>((obj) => LikeComments(obj));
            UserProfileCommand = new RelayCommand<object>((obj) => UserProfileNavigate(obj));

            var boolAuthorization = Convert.ToBoolean(GetParamsSetting(AuthorizationKey));
            if (boolAuthorization)
            {
                CommentsButtonVisible = true;
            }
        }
Example #11
0
 public MainViewModel()
 {
     AuthorizationLaterCommand = new RelayCommand(() => AuthorizationLater());
     RegistrationCommand = new RelayCommand(() => Registration());
     AuthorizationCommand = new RelayCommand(async () => await Authorization());
 }
 public MessageSenderViewModel()
 {
     SendMessageCommand = new RelayCommand(() => SendMessage());
 }
Example #13
0
 /// <summary>Initializes a new instance of the <see cref="MainWindowModel"/> class. </summary>
 public MainWindowModel()
 {
     ShowDialogCommand = new RelayCommand(ShowDialog);
 }
Example #14
0
 public MvvmSamplePageModel()
 {
     RunSampleCommand = new RelayCommand((Action)RunSample, () => SampleProperty != "Foo");
 }
Example #15
0
 /// <summary>Initializes a new instance of the <see cref="MainPageModel"/> class. </summary>
 public MainPageModel()
 {
     ShowDetailsCommand = new RelayCommand<Person>(ShowDetails);
 }
Example #16
0
 public SearchUserViewModel()
 {
     SelectedItemCommand = new RelayCommand<object>((obj) => SelectedItem(obj));
     SearchCommand = new RelayCommand(async () => await SearchUsers());
 }
Example #17
0
 public WeatherViewModel()
 {
     TownList = FillTownList();
     forecastItems = new ObservableCollection<Forecast>();
     ChngeTown = new RelayCommand<object>(async (obj) => await GetTownID(obj));
 }