コード例 #1
0
ファイル: RossPage.xaml.cs プロジェクト: dolkensp/OTWB
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     RossPathDisplay.CleanUp();
     //viewModel.CleanUpForPageChange();
     this.viewModel = null;
 }
コード例 #2
0
ファイル: StartPage.xaml.cs プロジェクト: dolkensp/OTWB
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     viewModel = App.viewModel;
     if (ViewModel.NeedsInitialising)
         viewModel.CreateData();
 }
コード例 #3
0
ファイル: Wheels.xaml.cs プロジェクト: dolkensp/OTWB
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                base.OnNavigatedTo(e);
                //viewModel = (ViewModel)e.Parameter;
                viewModel = App.viewModel;
                viewModel.SetupPattern(PatternType.wheels, null, -1);
                viewModel.WheelsDataChanged += viewModel_WheelsDataChanged;

                this.DataContext = viewModel;
                IncrementCombo.SelectedValue = viewModel.Increment;
                PatternChoices.ItemsSource = viewModel.WheelsPatterns;
                if (viewModel.CurrentPathData != null)
                    PatternChoices.SelectedIndex = viewModel.CurrentPathData.PatternIndex;


                PatternChoices.SelectionChanged += PatternChoices_SelectionChanged;

                ProgressRing1.IsActive = false;
                ReCalculate();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
コード例 #4
0
ファイル: RossPage.xaml.cs プロジェクト: dolkensp/OTWB
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     //viewModel = (ViewModel)e.Parameter;
     viewModel = App.viewModel;
     viewModel.SetupPattern(PatternType.ross, null, -1);
     this.DataContext = viewModel;
     RossPatternChoices.ItemsSource = viewModel.RossPatterns;
     RossIncrementCombo.SelectedValue = viewModel.Increment;
     RossPatternChoices.SelectedIndex = viewModel.CurrentPathData.PatternIndex;
     RossPatternChoices.SelectionChanged += PatternChoices_SelectionChanged;
     ReCalculate();
 }
コード例 #5
0
ファイル: MainPage.xaml.cs プロジェクト: dolkensp/OTWB
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            //viewModel = (ViewModel)e.Parameter;
            viewModel = App.viewModel;
            viewModel.SetupPattern(PatternType.bazley, null, -1);
            viewModel.CurrentPathData.PropertyChanged += CurrentPathData_PropertyChanged;
            this.DataContext = viewModel;
            IncrementCombo.SelectedValue = viewModel.Increment;

            PatternChoices.ItemsSource = viewModel.BazeleyPatterns;
            PatternChoices.SelectedIndex = viewModel.CurrentPathData.PatternIndex;     
            PatternChoices.SelectionChanged += PatternChoices_SelectionChanged;

            ProgressRing1.IsActive = false;
        }
コード例 #6
0
ファイル: GcodePage.xaml.cs プロジェクト: dolkensp/OTWB
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            viewModel = App.viewModel;

            if ((viewModel.CurrentPath == null) || (viewModel.CurrentPath.Count == 0))
            {
                await codeGen.ImportPath();
                GenerateGcode();
            }
            else
            {
                codeGen.ToolPaths = viewModel.CurrentPath;
                codeGen.CurrentPath = viewModel.CurrentPathAsListofPoint;
                codeGen.PathName = viewModel.CurrentPath.PatternName;
                codeGen.Profile = viewModel.CurrentProfile;
                GenerateGcode();
            }
        }
コード例 #7
0
ファイル: App.xaml.cs プロジェクト: dolkensp/OTWB
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="args">Details about the launch request and process.</param>
        protected async override void OnLaunched(LaunchActivatedEventArgs args)
        {
            AppSettings.Current.AddCommand<CodeSettingsContent>("Code Settings", SettingsFlyout.SettingsFlyoutWidth.Wide);
            viewModel = new ViewModel();
            CodeSettingsContext = new CodeGenDataContext();
            VisualElements = await Callisto.Controls.Common.AppManifestHelper.GetManifestVisualElementsAsync();
            Frame rootFrame = Window.Current.Content as Frame;

            SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;
            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                OTWB.Common.SuspensionManager.RegisterFrame(rootFrame, "appFrame");
                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                    await OTWB.Common.SuspensionManager.RestoreAsync();
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                if (!rootFrame.Navigate(typeof(StartPage), args.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
コード例 #8
0
ファイル: SpindlePage.xaml.cs プロジェクト: dolkensp/OTWB
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            //viewModel = (ViewModel)e.Parameter;
            viewModel = App.viewModel;
            viewModel.SetupPattern(PatternType.barrel, null, -1);
            this.DataContext = viewModel;
            BarrelChoices.SelectedIndex = viewModel.SelectedPathIndex;
            BarrelChoices.SelectionChanged += BarrelChoices_SelectionChanged;

            IncrementCombo.SelectedItem = viewModel.Increment;
            ReCalculate();
        }
コード例 #9
0
ファイル: LatticeRimPage.xaml.cs プロジェクト: dolkensp/OTWB
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            SettingsPane.GetForCurrentView().CommandsRequested += LatticePage_CommandsRequested;
            try
            {
                base.OnNavigatedTo(e);
                viewModel = App.viewModel;
                viewModel.SetupPattern(PatternType.latticeRim, null, -1);
                viewModel.LatticeDataChanged += viewModel_LatticeDataChanged;

                this.DataContext = viewModel;
                IncrementCombo.SelectedValue = viewModel.Increment;
                PatternChoices.ItemsSource = viewModel.LatticePatterns;
                if (viewModel.CurrentPathData != null)
                    PatternChoices.SelectedIndex = viewModel.CurrentPathData.PatternIndex;


                PatternChoices.SelectionChanged += PatternChoices_SelectionChanged;

                ProgressRing1.IsActive = false;
                ReCalculate();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }