Пример #1
0
        public HamburgerFrame()
        {
            Frame = new MtFrame();
            Frame.PageAnimation = null;
            Frame.Navigated    += FrameOnNavigated;

            Hamburger              = new Hamburger();
            Hamburger.Content      = Frame;
            Hamburger.ItemChanged += HamburgerOnItemChanged;
        }
Пример #2
0
        /// <summary>Called when a new instance of the application has been created. </summary>
        /// <param name="frame">The frame. </param><param name="args">The launch arguments.</param>
        public override Task OnInitializedAsync(MtFrame frame, ApplicationExecutionState args)
        {
            // TODO: Add your initialization logic here.

            var mapper = RegexViewModelToViewMapper.CreateDefaultMapper(GetType().GetTypeInfo().Assembly);

            Messenger.Default.Register(DefaultActions.GetNavigateMessageAction(mapper, frame));
            Messenger.Default.Register(DefaultActions.GetGoBackMessageAction(frame));
            Messenger.Default.Register(DefaultActions.GetTextMessageAction());

            return(base.OnInitializedAsync(frame, args));
        }
Пример #3
0
        private void InitializeFrame()
        {
            var frame = new MtFrame();

            frame.DisableForwardStack = false;
            frame.Navigated          += Frame_Navigated;
            this.RootFrame            = frame;
            this.NavigationService    = new MtNavigationService(frame);

            this.ConfigureContainer();
            this.ConfigureViewModelLocator();
        }
Пример #4
0
        public override Task OnInitializedAsync(MtFrame frame, ApplicationExecutionState args)
        {
            // TODO: Called when the app is started (not resumed)

            //frame.PageAnimation = new TurnstilePageAnimation { UseBitmapCacheMode = true };
            //frame.PageAnimation = new PushPageAnimation();

            var mapper = RegexViewModelToViewMapper.CreateDefaultMapper(typeof(App).GetTypeInfo().Assembly);

            Messenger.Default.Register(DefaultActions.GetNavigateMessageAction(mapper, frame));

            return(null);
        }
Пример #5
0
        public Shell(MtFrame rootFrame)
        {
            this.RootFrame = rootFrame;

            this.InitializeComponent();

            this.main_content.Content = this.RootFrame;

            this.Loaded += Shell_Loaded;

            this.HideToastTimer          = new DispatcherTimer();
            this.HideToastTimer.Interval = TimeSpan.FromSeconds(3);
            this.HideToastTimer.Tick    += HideToastTimer_Tick;
        }
Пример #6
0
 /// <summary>Gets the default handling action of <see cref="NavigateMessage"/> objects. </summary>
 /// <param name="mapper">The mapper which maps view model types to view types. </param>
 /// <param name="frame">The frame. </param>
 /// <returns>The message action. </returns>
 public static Action <NavigateMessage> GetNavigateMessageAction(IViewModelToViewMapper mapper, MtFrame frame)
 {
     return(async message => await frame.NavigateAsync(mapper.Map(message.ViewModelType), message.Parameter));
 }
Пример #7
0
 /// <summary>Gets the default handling action of <see cref="GoBackMessage"/> objects. </summary>
 /// <param name="frame">The frame to call the navigation methods on. </param>
 /// <returns>The message action. </returns>
 public static Action <GoBackMessage> GetGoBackMessageAction(MtFrame frame)
 {
     return(message => frame.GoBackAsync());
 }
Пример #8
0
 public override async Task OnInitializedAsync(MtFrame frame, ApplicationExecutionState args)
 {
     //await HideStatusBarAsync();
     ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(320, 320));
 }
Пример #9
0
 public override async Task OnInitializedAsync(MtFrame frame, ApplicationExecutionState args)
 {
     //await HideStatusBarAsync();
 }