Exemplo n.º 1
0
 private void menuNewDoc_Click(object sender, EventArgs e)
 {
     //execute New Document command
     ICommand command = new CreateNewDocument();
     command.OnCreate(m_mapControl.Object);
     command.OnClick();
 }
Exemplo n.º 2
0
        //新建图层
        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            ICommand command = new CreateNewDocument();

            command.OnCreate(mapControl.Object);
            command.OnClick();
        }
Exemplo n.º 3
0
        private void menuNewDoc_Click(object sender, EventArgs e)
        {
            //execute New Document command
            ICommand command = new CreateNewDocument();

            command.OnCreate(m_mapControl.Object);
            command.OnClick();
        }
Exemplo n.º 4
0
        public MainPage(IServiceProvider provider
                        , ILogger <MainPage> logger
                        , DocumentViewModel <StorageFile, IRandomAccessStream> viewModel
                        , QuickPadCommands <StorageFile, IRandomAccessStream> command
                        , IVisualThemeSelector vts)
        {
            Provider   = provider;
            VtSelector = vts;
            Logger     = logger;
            Commands   = command;

            Clipboard.ContentChanged += Clipboard_ContentChanged;

            GotFocus += OnGotFocus;

            Initialize?.Invoke(this, Commands, App);

            this.InitializeComponent();

            var rtfOptions = provider.GetService <RtfDocumentOptions>();

            rtfOptions.Document  = RichEditBox.Document;
            rtfOptions.Logger    = provider.GetService <ILogger <RtfDocument> >();
            rtfOptions.ViewModel = viewModel;

            var textOptions = provider.GetService <TextDocumentOptions>();

            textOptions.Document  = TextBox;
            textOptions.Logger    = provider.GetService <ILogger <TextDocument> >();
            textOptions.ViewModel = viewModel;

            CreateNewDocument?.Invoke(this);


            DataContext = ViewModel = viewModel;

            Loaded   += OnLoaded;
            Unloaded += OnUnloaded;

            //extent app in to the title bar
            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

            var tBar = ApplicationView.GetForCurrentView().TitleBar;

            tBar.ButtonBackgroundColor         = Colors.Transparent;
            tBar.ButtonInactiveBackgroundColor = Colors.Transparent;


            Settings.ExitApplication = ExitApp;

            ViewModel.PropertyChanged += ViewModel_PropertyChanged;

            Settings.PropertyChanged += Settings_PropertyChanged;

            ViewModel.SetScale += ViewModel_SetScale;

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest;

            var currentView = SystemNavigationManager.GetForCurrentView();

            currentView.BackRequested += CurrentView_BackRequested;

            commandBar.SetFontName += CommandBarOnSetFontName;
            commandBar.SetFontSize += CommandBarOnSetFontSize;

            if (SystemInformation.TotalLaunchCount == 3)
            {
                var(success, dialog) = provider.GetService <DialogManager>().RequestDialog <AskForReviewDialog>();

                if (!success)
                {
                    return;
                }

                _ = dialog.ShowAsync();
            }

            _initialized = true;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Event handler for creating a new document
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void menuNewDoc_Click(object sender, EventArgs e)
 {
     //execute New Document command
     ICreateNewDocument iCreateNewDocument = new CreateNewDocument ();
     ICommand command = (ICommand)iCreateNewDocument;
     command.OnCreate(getSetMapControl.Object);
     command.OnClick();
 }
Exemplo n.º 6
0
 private void menuNewDoc_Click(object sender, EventArgs e)
 {
     //execute New Document command
     ICommand command = new CreateNewDocument();
     command.OnCreate(m_mapControl.Object);
     command.OnClick();
     axMapControl2.ClearLayers();
     IGraphicsContainer pGraphicsContainer = axMapControl2.Map as IGraphicsContainer;
     //在绘制前,清除axMapControl2中的任何图形元素
     pGraphicsContainer.DeleteAllElements();
 }