示例#1
0
 public LoginViewModel(INavigationRoot root, string childName) : base(root, childName)
 {
     _api = new LazyScalar <IInstaApi>(() =>
                                       new WrapApi(
                                           new SessionData(Login, Password), _http
                                           ).Value()
                                       );
 }
示例#2
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending         += OnSuspending;
            this.UnhandledException += (sender, e) =>
            {
                //this is "our" MainViewModel
                INavigationRoot navigationRoot = Window.Current.Content
                                                 .As <Frame>().Content
                                                 .As <FrameworkElement>().DataContext
                                                 .As <INavigationRoot>();

                navigationRoot.NavigateTo(
                    "main",
                    new ErrorViewModelWithNavigationCommands(navigationRoot, e.Exception)
                    );
            };
        }
示例#3
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending         += OnSuspending;
            this.UnhandledException += (sender, e) =>
            {
                e.Handled = true;
                _logger.Error($"app encountered an unhandled exception: {e.Exception.ToString()}");

                //this is "our" MainViewModel
                INavigationRoot navigationRoot = Window.Current.Content
                                                 .As <Frame>().Content
                                                 .As <FrameworkElement>().DataContext
                                                 .As <INavigationRoot>();

                navigationRoot.NavigateTo(
                    "main",
                    new ErrorViewModelWithNavigationCommands(navigationRoot, e.Exception)
                    );
            };
            _logger.Information("app started succesfully");
        }
示例#4
0
 public BlankViewModel(INavigationRoot root, string childName = MainChild) : base(root, childName)
 {
 }
示例#5
0
 public PleaseWaitViewModel(INavigationRoot root, string child) : base(root, child)
 {
 }
示例#6
0
 public SecondPartViewModel(INavigationRoot root, string childName = "main") : base(root, childName)
 {
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of <see cref="ErrorViewModel"/>.
 /// </summary>
 /// <param name="root">The parent.</param>
 /// <param name="exception">An error.</param>
 /// <param name="childName">The name of the child.</param>
 public ErrorViewModel(INavigationRoot root, Exception exception, string childName = MainChild) : this(root, exception.ToString(), childName)
 {
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of <see cref="ErrorViewModel"/>.
 /// </summary>
 /// <param name="root">The parent.</param>
 /// <param name="error">An error.</param>
 /// <param name="childName">The name of the child.</param>
 public ErrorViewModel(INavigationRoot root, string error, string childName = MainChild) : this(root, childName)
 {
     Error = error;
 }
示例#9
0
 public PopupService(INavigationRoot navigationRoot, IBusyIndicator busyIndicator)
 {
     _navigationRoot = navigationRoot;
     _busyIndicator  = busyIndicator;
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of <see cref="RedirectViewModel"/>.
 /// </summary>
 /// <param name="root">The <see cref="INavigationRoot"/>.</param>
 /// <param name="childName">The name of a child.</param>
 public RedirectViewModel(INavigationRoot root, string childName = MainChild)
 {
     _root  = root.CheckNotNull("navigation root");
     _child = childName.CheckNotNull(nameof(childName));
 }
示例#11
0
 public BlankPageViewModel(INavigationRoot root, string childName = "main") : base(root, childName)
 {
 }
示例#12
0
 /// <summary>
 /// Initializes a new instance of <see cref="RedirectViewModelWithContent"/>.
 /// </summary>
 /// <param name="root">The navigation root.</param>
 /// <param name="childName">The name of the child.</param>
 public RedirectViewModelWithContent(INavigationRoot root, string childName)
 {
     _root  = root;
     _child = childName;
 }
示例#13
0
 public OtherPageViewModel(INavigationRoot root, string childName) : base(root, childName)
 {
 }
示例#14
0
 /// <summary>
 /// Initializes a new instance of <see cref="ErrorViewModelWithNavigationCommands"/>.
 /// </summary>
 /// <param name="root">The parent.</param>
 /// <param name="error">An error.</param>
 public ErrorViewModelWithNavigationCommands(INavigationRoot root, Exception error) : this(new ErrorViewModel(root, error))
 {
 }
示例#15
0
 public NavigationService(IPageFactory pageFactory, INavigationRoot navigationRoot)
 {
     _pageFactory    = pageFactory;
     _navigationRoot = navigationRoot;
 }