コード例 #1
0
ファイル: SSMMainView.xaml.cs プロジェクト: chenmj201601/UMP
        private void ModifyScoreSheet(ScoreSheetItem item)
        {
            if (item != null)
            {
                //ShowInformation(string.Format("Modify scoresheet:{0}", item.Name));
                var basicScoreSheetInfo = item.Data as BasicScoreSheetInfo;
                if (basicScoreSheetInfo != null)
                {
                    S3101App.CurrentScoreSheetInfo = basicScoreSheetInfo;
                    S3101App.IsModifyScoreSheet    = true;

                    //if (NavigationService != null)
                    //    NavigationService.Navigate(new Uri("SSDMainPage.xaml", UriKind.Relative));

                    SSDMainView view = new SSDMainView();
                    view.CurrentApp        = CurrentApp;
                    view.PageName          = "SSDMainPage";
                    CurrentApp.CurrentView = view;
                    if (CurrentApp.RunAsModule)
                    {
                        CurrentApp.InitCurrentView();
                    }
                    else
                    {
                        var app = App.Current;
                        if (app != null)
                        {
                            var window = app.MainWindow;
                            if (window != null)
                            {
                                var shell = window.Content as Shell;
                                if (shell != null)
                                {
                                    shell.SetView(view);
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
ファイル: SSMMainView.xaml.cs プロジェクト: chenmj201601/UMP
        private void CreateScoreSheet()
        {
            //ShowInformation(string.Format("Create ScoreSheet"));
            try
            {
                S3101App.IsModifyScoreSheet = false;

                SSDMainView view = new SSDMainView();
                view.CurrentApp        = CurrentApp;
                view.PageName          = "SSDMainPage";
                CurrentApp.CurrentView = view;
                if (CurrentApp.RunAsModule)
                {
                    CurrentApp.InitCurrentView();
                }
                else
                {
                    var app = App.Current;
                    if (app != null)
                    {
                        var window = app.MainWindow;
                        if (window != null)
                        {
                            var shell = window.Content as Shell;
                            if (shell != null)
                            {
                                shell.SetView(view);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }