Beispiel #1
0
        public MainPage(IActivatedEventArgs args)
        {
            this.InitializeComponent();

            ViewModel        = new MainViewmodel(args);
            this.DataContext = ViewModel;

            #region registering for messages
            Messenger.Default.Register <LocalNotificationMessageType>(this, RecieveLocalNotificationMessage);
            Messenger.Default.Register(this, delegate(SetHeaderTextMessageType m) { SetHeadertext(m.PageName); });
            Messenger.Default.Register(this, delegate(AdsEnabledMessageType m) { ViewModel.ToggleAdsVisiblity(); });
            Messenger.Default.Register(this, delegate(HostWindowBlurMessageType m) { ConfigureWindowBlur(); });
            Messenger.Default.Register(this, delegate(UpdateUnreadNotificationMessageType m) { ViewModel.UpdateUnreadNotificationIndicator(m.IsUnread); });
            Messenger.Default.Register(this, async delegate(ShowWhatsNewPopupMessageType m) { await ShowWhatsNewPopupVisiblity(); });
            Messenger.Default.Register <User>(this, ViewModel.RecieveSignInMessage);
            #endregion

            notifManager = new LocalNotificationManager(NotificationGrid);

            Loaded      += MainPage_Loaded;
            SizeChanged += MainPage_SizeChanged;

            SimpleIoc.Default.Register <IAsyncNavigationService>(() => { return(new NavigationService(AppFrame)); });
            SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;

            NavigationCacheMode = NavigationCacheMode.Enabled;
        }
Beispiel #2
0
        public MainPage()
        {
            this.InitializeComponent();

            ViewModel        = new MainViewmodel();
            this.DataContext = ViewModel;

            #region registering for messages
            Messenger.Default.Register <LocalNotificationMessageType>(this, RecieveLocalNotificationMessage);
            Messenger.Default.Register(this, delegate(SetHeaderTextMessageType m) { SetHeadertext(m.PageName); });
            Messenger.Default.Register(this, delegate(AdsEnabledMessageType m) { ViewModel.ConfigureAdsVisibility(); });
            Messenger.Default.Register(this, delegate(HostWindowBlurMessageType m) { ConfigureWindowBlur(); });
            Messenger.Default.Register(this, delegate(UpdateUnreadNotificationMessageType m) { ViewModel.UpdateUnreadNotificationIndicator(m.IsUnread); });
            Messenger.Default.Register <User>(this, ViewModel.RecieveSignInMessage);
            #endregion

            Loaded += MainPage_Loaded;

            NavigationCacheMode = NavigationCacheMode.Enabled;
        }
Beispiel #3
0
        public MainPage(IActivatedEventArgs args)
        {
            this.InitializeComponent();

            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;

            coreTitleBar.ExtendViewIntoTitleBar = true;

            coreTitleBar.LayoutMetricsChanged += delegate
            {
                AppTitleBar.Height = coreTitleBar.Height;
            };

            // Set a XAML element as title bar
            Window.Current.SetTitleBar(AppTitleBar);

            ViewModel        = new MainViewmodel(args);
            this.DataContext = ViewModel;

            #region registering for messages
            Messenger.Default.Register <LocalNotificationMessageType>(this, RecieveLocalNotificationMessage);
            Messenger.Default.Register(this, delegate(SetHeaderTextMessageType m) { SetHeadertext(m.PageName); });
            Messenger.Default.Register(this, delegate(AdsEnabledMessageType m) { ViewModel.ToggleAdsVisiblity(); });
            Messenger.Default.Register(this, delegate(UpdateUnreadNotificationMessageType m) { ViewModel.UpdateUnreadNotificationIndicator(m.IsUnread); });
            Messenger.Default.Register(this, async delegate(ShowWhatsNewPopupMessageType m) { await ShowWhatsNewPopupVisiblity(); });
            Messenger.Default.Register <User>(this, ViewModel.RecieveSignInMessage);
            #endregion

            notifManager = new LocalNotificationManager(NotificationGrid);

            Loaded      += MainPage_Loaded;
            SizeChanged += MainPage_SizeChanged;

            SimpleIoc.Default.Register <IAsyncNavigationService>(() => { return(new NavigationService(AppFrame)); });
            SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;

            NavigationCacheMode = NavigationCacheMode.Enabled;
        }