Inheritance: EditorWindow
        public WindowCommands GetRightWindowCommands()
        {
            var windowCommands = new WindowCommands();

            var refreshButton = WindowCommandHelper.CreateWindowCommandButton("appbar_refresh_counterclockwise_down", "refresh");

            refreshButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, _commandManager.GetCommand("File.Refresh"));
            _commandManager.RegisterAction("File.Refresh", () => _messageService.ShowAsync("Refresh"));
            windowCommands.Items.Add(refreshButton);

            var saveButton = WindowCommandHelper.CreateWindowCommandButton("appbar_save", "save");

            saveButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, _commandManager.GetCommand("File.Save"));
            _commandManager.RegisterAction("File.Save", () => _messageService.ShowAsync("Save"));
            windowCommands.Items.Add(saveButton);

            var showWindowButton = WindowCommandHelper.CreateWindowCommandButton("appbar_new_window", "show dialog window");

            showWindowButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, new TaskCommand(() => _uiVisualizerService.ShowDialogAsync <ExampleDialogViewModel>()));
            windowCommands.Items.Add(showWindowButton);

            var showDataWindowButton = WindowCommandHelper.CreateWindowCommandButton("appbar_new_window", "show data window");

            showDataWindowButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, new TaskCommand(() => _uiVisualizerService.ShowDialogAsync <ExampleDataViewModel>()));
            windowCommands.Items.Add(showDataWindowButton);

            return(windowCommands);
        }
Exemple #2
0
        public WindowCommands GetRightWindowCommands()
        {
            var windowCommands = new WindowCommands();

            var refreshButton = WindowCommandHelper.CreateWindowCommandButton("appbar_refresh_counterclockwise_down", "refresh");

            refreshButton.Command = _commandManager.GetCommand("File.Refresh");
            _commandManager.RegisterAction("File.Refresh", () => _messageService.ShowAsync("Refresh"));
            windowCommands.Items.Add(refreshButton);

            var saveButton = WindowCommandHelper.CreateWindowCommandButton("appbar_save", "save");

            saveButton.Command = _commandManager.GetCommand("File.Save");
            _commandManager.RegisterAction("File.Save", () => _messageService.ShowAsync("Save"));
            windowCommands.Items.Add(saveButton);

            var showWindowButton = WindowCommandHelper.CreateWindowCommandButton("appbar_new_window", "show dialog window");

            showWindowButton.Command = new Command(() => _uiVisualizerService.ShowDialog <ExampleDialogViewModel>());
            windowCommands.Items.Add(showWindowButton);

            var showDataWindowButton = WindowCommandHelper.CreateWindowCommandButton("appbar_new_window", "show data window");

            showDataWindowButton.Command = new Command(() => _uiVisualizerService.ShowDialog <ExampleDataViewModel>());
            windowCommands.Items.Add(showDataWindowButton);

            return(windowCommands);
        }
        public async Task <string> GoForward(CancellationToken cancellationToken = default(CancellationToken))
        {
            var res = await WindowCommands.GoForward(Session, cancellationToken);

            Session?.SwitchToTopFrame();
            return(res);
        }
        void InitFW()
        {
            //Add state changed handler.
            StateChanged += (object sender, System.EventArgs e) =>
            {
                if ((bool)GetValue(IsFullscreenProperty) == true & WindowState == System.Windows.WindowState.Normal)
                {
                    SetValue(IsFullscreenProperty, false);
                }
            };
            //Add fullscreen clicked handler
            b.Click += (object sender, RoutedEventArgs e) => {
                if ((bool)GetValue(IsFullscreenProperty) == false)
                {
                    SetValue(IsFullscreenProperty, true);
                }
                else
                {
                    SetValue(IsFullscreenProperty, false);
                }
            };
            var commands = new WindowCommands();

            commands.Items.Add(b);
            RightWindowCommands = commands;
        }
Exemple #5
0
        private void InitializeComponent()
        {
            // setting up user name and app version buttons
            var windowButtons = new WindowCommands();

            var userButton = new Button()
            {
                Content = CurrentUser, ToolTip = "Active User. Click to copy to clipboard.", Focusable = false
            };

            userButton.Click += Copy_Button_Title;
            windowButtons.Items.Add(userButton);

            if (AppVersion != null && AppVersion != string.Empty)
            {
                var versionButton = new Button()
                {
                    Content = AppVersion, ToolTip = "Version. Click to copy to clipboard.", Focusable = false
                };
                versionButton.Click += Copy_Button_Title;
                windowButtons.Items.Add(versionButton);
            }

            RightWindowCommands = windowButtons;

            TitleCharacterCasing = CharacterCasing.Normal;
            SaveWindowPosition   = true;
        }
        /// <inheritdoc />
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            TitleBar = GetTemplateChild(PART_RibbonTitleBar) as RibbonTitleBar;

            if (iconImage != null)
            {
                iconImage.MouseDown -= HandleIconMouseDown;
            }

            if (WindowCommands == null)
            {
                WindowCommands = new WindowCommands();
            }

            iconImage = GetPart <FrameworkElement>(PART_Icon);

            if (iconImage != null)
            {
                iconImage.MouseDown += HandleIconMouseDown;
            }

            GetPart <UIElement>(PART_Icon)?.SetValue(WindowChrome.IsHitTestVisibleInChromeProperty, true);
            GetPart <UIElement>(PART_WindowCommands)?.SetValue(WindowChrome.IsHitTestVisibleInChromeProperty, true);
        }
 public void CreateDriverCore()
 {
     Session         = new Session(sessionId++);
     FrameTracker    = new FrameTracker(DevTools);
     WebView         = new WebView(DevTools, FrameTracker, this);
     Mouse           = new ChromeDriverMouse(WebView, Session);
     Keyboard        = new ChromeDriverKeyboard(WebView);
     ElementUtils    = new ElementUtils(WebView, Session);
     ElementCommands = new ElementCommands(WebView, Session, ElementUtils, this);
     WindowCommands  = new WindowCommands(WebView, Session, this);
 }
Exemple #8
0
        public WindowCommands GetRightWindowCommands()
        {
            var windowCommands = new WindowCommands();

            var refreshButton = WindowCommandHelper.CreateWindowCommandButton("appbar_refresh_counterclockwise_down", "refresh");
            refreshButton.Command = _commandManager.GetCommand("File.Refresh");
            _commandManager.RegisterAction("File.Refresh", () => _messageService.ShowAsync("Refresh"));
            windowCommands.Items.Add(refreshButton);

            var saveButton = WindowCommandHelper.CreateWindowCommandButton("appbar_save", "save");
            saveButton.Command = _commandManager.GetCommand("File.Save");
            _commandManager.RegisterAction("File.Save", () => _messageService.ShowAsync("Save"));
            windowCommands.Items.Add(saveButton);

            var showWindowButton = WindowCommandHelper.CreateWindowCommandButton("appbar_new_window", "show window");
            showWindowButton.Command = new Command(() => _uiVisualizerService.ShowDialog<ExampleDialogViewModel>());
            windowCommands.Items.Add(showWindowButton);

            return windowCommands;
        }
        private async void Delete()
        {
            // TODO remove App.WMain
            var currentThumbsGrid = _core.ThumbnailsGridsM.Current;
            var items             = _coreVM.AppInfo.AppMode == AppMode.Viewer
        ? new() { Model.Current }
        : currentThumbsGrid.FilteredItems.Where(x => x.IsSelected).ToList();
            var count = items.Count;

            if (!MessageDialog.Show("Delete Confirmation",
                                    $"Do you really want to delete {count} item{(count > 1 ? "s" : string.Empty)}?", true))
            {
                return;
            }

            Model.Current = MediaItemsM.GetNewCurrent(currentThumbsGrid != null
          ? currentThumbsGrid.LoadedItems
          : App.WMain.MediaViewer.MediaItems,
                                                      items);

            Model.Delete(items, AppCore.FileOperationDelete);
            await _coreVM.ThumbnailsGridsVM.ThumbsGridReloadItems();

            if (_coreVM.MainTabsVM.Selected is SegmentMatchingControl smc)
            {
                _ = smc.SortAndReload();
            }

            if (_coreVM.AppInfo.AppMode == AppMode.Viewer)
            {
                _ = App.WMain.MediaViewer.MediaItems.Remove(items[0]);
                if (Model.Current != null)
                {
                    App.WMain.MediaViewer.SetMediaItemSource(Model.Current);
                }
                else
                {
                    WindowCommands.SwitchToBrowser();
                }
            }
        }
Exemple #10
0
        private void InitializeComponent()
        {
            // setting up user name and app version buttons
            var windowButtons = new WindowCommands();

            var userButton = new Button()
            {
                Content   = CurrentUser,
                ToolTip   = "Active User. Click to copy to clipboard.",
                Focusable = false
            };

            userButton.Click += Copy_Button_Title;
            windowButtons.Items.Add(userButton);

            if (AppVersion != null && AppVersion != string.Empty)
            {
                // create a toolbar button and bind to appversion
                Binding myBinding = new Binding();
                myBinding.Source = this;
                myBinding.Path   = new PropertyPath("AppVersion");
                myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;

                var versionButton = new Button()
                {
                    ToolTip   = "Version. Click to copy to clipboard.",
                    Focusable = false,
                };

                BindingOperations.SetBinding(versionButton, Button.ContentProperty, myBinding);

                versionButton.Click += Copy_Button_Title;
                windowButtons.Items.Add(versionButton);
            }

            RightWindowCommands = windowButtons;
            LeftWindowCommands  = new WindowCommands();

            TitleCharacterCasing = CharacterCasing.Normal;
            SaveWindowPosition   = true;
        }
Exemple #11
0
        private void getSettings()
        {
            WindowStartupLocation = WindowStartupLocation.CenterOwner;
            ResizeMode            = ResizeMode.CanResizeWithGrip;
            //Uri iconUri = new Uri("pack://MatchingDash:,,,/Pics/LeftCorner.ico", UriKind.RelativeOrAbsolute);
            //Icon = BitmapFrame.Create(iconUri);
            var theme  = ThemeManager.DetectAppStyle(Application.Current);
            var accent = ThemeManager.GetAccent("Green");

            ThemeManager.ChangeAppStyle(Application.Current, accent, theme.Item1);
            ShowIconOnTitleBar = true;
            TitleCaps          = true;
            FontSize           = 12;
            FontWeight         = FontWeights.SemiBold;
            BorderThickness    = new Thickness(1);
            GlowBrush          = null;
            BorderBrush        = this.FindResource("AccentColorBrush") as Brush;
            //SelectiveScrollingOrientation scroll = SelectiveScrollingOrientation.Both;
            WindowCommands sidewindow = new WindowCommands();
            // Background = new SolidColorBrush(Color.FromRgb(176, 196, 222));
        }
Exemple #12
0
        public WindowCommands GetRightWindowCommands()
        {
            var windowCommands = new WindowCommands();

            var refreshButton = WindowCommandHelper.CreateWindowCommandButton(new PackIconMaterial {
                Kind = PackIconMaterialKind.Refresh
            }, "Refresh");

            refreshButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, _commandManager.GetCommand("File.Refresh"));
            _commandManager.RegisterAction("File.Refresh", () => _messageService.ShowAsync("Refresh"));
            windowCommands.Items.Add(refreshButton);

            var saveButton = WindowCommandHelper.CreateWindowCommandButton(new PackIconMaterial {
                Kind = PackIconMaterialKind.ContentSave
            }, "Save");

            saveButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, _commandManager.GetCommand("File.Save"));
            _commandManager.RegisterAction("File.Save", () => _messageService.ShowAsync("Save"));
            windowCommands.Items.Add(saveButton);

            var showWindowButton = WindowCommandHelper.CreateWindowCommandButton(new PackIconMaterial {
                Kind = PackIconMaterialKind.OpenInNew
            }, "Show dialog window");

            showWindowButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, new TaskCommand(() => _uiVisualizerService.ShowDialogAsync <ExampleDialogViewModel>()));
            windowCommands.Items.Add(showWindowButton);

            var showDataWindowButton = WindowCommandHelper.CreateWindowCommandButton(new PackIconMaterial {
                Kind = PackIconMaterialKind.OpenInNew
            }, "Show data window");

            showDataWindowButton.SetCurrentValue(System.Windows.Controls.Primitives.ButtonBase.CommandProperty, new TaskCommand(() => _uiVisualizerService.ShowDialogAsync <ExampleDataViewModel>()));
            windowCommands.Items.Add(showDataWindowButton);

            return(windowCommands);
        }
Exemple #13
0
 public WindowCommandsAutomationPeer([NotNull] WindowCommands owner)
     : base(owner)
 {
 }
 public async Task <string> GoToUrl(string url, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await WindowCommands.GoToUrl(url, null, cancellationToken));
 }
        public async Task <string> GetPageSource(CancellationToken cancellationToken = default(CancellationToken))
        {
            var res = await WindowCommands.GetPageSource(null, cancellationToken);

            return(res);
        }
 public Task <JToken> FindElements(string strategy, string expr, string startNode = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(WindowCommands.FindElements(strategy, expr, startNode, null, cancellationToken));
 }
 public WindowCommandsAutomationPeer(WindowCommands owner)
     : base(owner)
 {
 }
 public Task <string> GetUrl(CancellationToken cancellationToken = default(CancellationToken))
 {
     return(WindowCommands.GetCurrentUrl());
 }