示例#1
1
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            #if DEBUG
            if (Debugger.IsAttached)
            {
               // this.DebugSettings.EnableFrameRateCounter = true;
            }
            #endif
            var appVm = new AppVm();
            var shell = Window.Current.Content as AppShell;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (shell == null)
            {
                // Create a AppShell to act as the navigation context and navigate to the first page
                shell = new AppShell();

                // Set the default language
                shell.Language = ApplicationLanguages.Languages[0];

                shell.AppFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }
            }

            // Place our app shell in the current Window
            Window.Current.Content = shell;

            if (shell.AppFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                shell.AppFrame.Navigate(typeof(NewSimPage), e.Arguments, new SuppressNavigationTransitionInfo());
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }
示例#2
0
        public ViewPageVm(AppVm appModel)
        {
            AppVm = appModel;
            AppVm.OnReportReady.Subscribe(DisplaySim);
            InitUi();

        }
示例#3
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     MainWindow             = new MainWindow();
     AppVm                  = new AppVm(MainWindow);
     MainWindow.DataContext = AppVm;
     MainWindow.Show();
 }
示例#4
0
 public CreateCliquePageVm(AppVm appModel)
 {
     AppVm = appModel;
     SetProps(
         AppVm.Current.GetVmData(
             VmConfigs.DefaultCreateCliqueE
             )
         );
 }
示例#5
0
 public CreateCliqueAPageVm(AppVm appModel)
 {
     AppVm = appModel;
     AppVm.StopSim();
     SetProps(
         AppVm.Current.GetVmData(
             CliqueVmConfigs.DefaultCreateCliqueEa
             )
         );
 }
示例#6
0
 public CreateRingAPageVm(AppVm appModel)
 {
     AppVm = appModel;
     AppVm.StopSim();
     SetProps(
         AppVm.Current.GetVmData(
             RingVmConfigs.DefaultCreateRingEa
             )
         );
 }
示例#7
0
 public SandboxVm(AppVm appModel)
 {
     AppVm = appModel;
     //ProjectionControlVm = new ProjectionControlVmD();
     //GroupSelectorVm = new GroupSelectorVmD();
     // GraphVmD = new GraphVmD();
     //Hist1DvmD = new Hist1DvmD();
     // Hist2DvmD = new Hist2DvmD();
     //Grid2DVm = new Grid2DVmD();
     Grid4DVm = new Grid4DVmD();
 }
示例#8
0
        public ViewCPageVm(AppVm appModel)
        {
            AppVm = appModel;
            AppVm.OnReportReady.Subscribe(DisplaySim);

            var scse = (SimUtils.SimCliqueSetForEpoch)appModel.Sim;
            var ngM = scse.CliqueNetworkTr.NodeGroups;
            HistogramVm = new Hist1DVm(5);
            ProjectionControlVm = new ProjectionControlVm(Enumerable.Range(0, scse.Memories.ColumnCount));
            InitUi();
        }
示例#9
0
        public ViewHPageVm(AppVm appModel)
        {
            AppVm = appModel;
            AppVm.OnReportReady.Subscribe(DisplaySim);

            var scse = (SimUtils.SimCliqueSetForEpoch)appModel.Sim;
            var ngM = scse.CliqueNetworkTr.NodeGroups;
            HistogramVm = new Hist1DVm(2);
            //MatrixSfVm = new MatrixSfVm(1, ngM.ColumnCount, ngM.RowCount);
            LastRepIteration = 0;
            GraphVm = new GraphVm();
            InitUi();
        }
示例#10
0
        public App()
        {
            InitializeComponent();

            ConfigureServices();

            Vm = new AppVm(ModelDataService, NavigationService);

            var page = new MainPage();

            page.BindingContext = Vm;

            var nav = new NavigationPage(page);

            MainPage = nav;
        }
示例#11
0
        public IActionResult Index()
        {
            var user    = GetCurrentUser();
            var account = AccountStore.GetAccount(user.Name);
            var vm      = new AppVm();

            if (account == null)
            {
                account         = AccountStore.AddAccount(user.Name);
                vm.IsNewAccount = true;
            }

            vm.Wallet  = account.Wallet;
            vm.Balance = AccountStore.GetBalance(account.Wallet.GetAccount(0).Address);

            return(View(vm));
        }
示例#12
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // hier den Glue Code ergänzen (DataContext von MainWindow,
            // sowie ViewModels etc.):
            // ...

            Vm = new AppVm();

            MainWindow             = new MainWindow();
            MainWindow.DataContext = Vm;
            MainWindow.Show();

            // ... und nicht vergessen, im App.xaml die Property
            // StartupUri zu entfernen, falls das MainWindow hier
            // erzeugt und angezeigt wird (wie z.B. in Ü4).
        }
示例#13
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // bei mehreren Services macht es Sinn, über das Auslagern
            // des Init-Codes in eine eigene Methode nachzudenken:
            ConfigureServices();

            // hier den Glue Code ergänzen (DataContext von MainWindow,
            // sowie ViewModels etc.):
            // ...

            Vm = new AppVm(ModelDataService, NavigationService);

            MainWindow             = new MainWindow();
            MainWindow.DataContext = Vm;
            MainWindow.Show();

            // ... und nicht vergessen, im App.xaml die Property
            // StartupUri zu entfernen, falls das MainWindow hier
            // erzeugt und angezeigt wird (wie z.B. in Ü4).
        }
示例#14
0
 public MainMenuPageVm(AppVm appModel)
 {
     AppVm = appModel;
 }
示例#15
0
 public NewSimPageVm(AppVm appModel)
 {
     AppVm = appModel;
 }