Ejemplo n.º 1
0
        public ThemeEditorPage()
        {
            InitializeComponent();
            _ThemeEditorPage = this;

            MakeThemeUIEditable();
            UpdateText(App.Text.Editing, App.Text.Active);

            var files = Directory.EnumerateFiles(Path.Combine("Assets", "Themes"))
                        .Concat(Directory.EnumerateFiles(FileLocations.ThemesFolder)).ToArray();

            for (var i = 0; i < files.LongCount(); i++)
            {
                if (files[i] == _designerXamlFile)
                {
                    continue;
                }
                MakeThemeUI(files[i], putActive: true).ConfigureAwait(false).GetAwaiter().GetResult();
            }

            //Trigger the first border mouse down event to make it the selected border
            var mouseDownEvent =
                new MouseButtonEventArgs(Mouse.PrimaryDevice, (int)DateTime.Now.Ticks, MouseButton.Left)
            {
                RoutedEvent = MouseDownEvent,
                Source      = this
            };

            borderColour1.RaiseEvent(mouseDownEvent);
        }
Ejemplo n.º 2
0
 private void Frame_MouseLeave(object sender, MouseEventArgs e)
 {
     _lastFrameMouseWasIn = null;
     ThemeEditorPage.UpdateGlobalUI();
     SetThemeStatusInUI("", themesFrame: (Frame)sender,
                        doNotSetIfContains: new[] { App.Text.Active, App.Text.Editing });
 }
Ejemplo n.º 3
0
 private void Theme_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     App.Config.ActiveTheme = ((Frame)sender).Tag.ToString();
     App.Config.Save();
     SetThemeStatusInUI("", removeActiveOnOtherTextBoxes: true);
     SetThemeStatusInUI(App.Text.Active, themesFrame: (Frame)sender);
     ThemeEditorPage.UpdateGlobalUI();
 }
Ejemplo n.º 4
0
        private async void Frame_MouseEnter(object sender, MouseEventArgs e)
        {
            var lastFrameMouseWasIn = _lastFrameMouseWasIn = (string)((Frame)sender).Tag;
            await Task.Delay(TimeSpan.FromSeconds(0.5));

            if (lastFrameMouseWasIn == _lastFrameMouseWasIn)
            {
                ThemeEditorPage.UpdateGlobalUI(lastFrameMouseWasIn);
                SetThemeStatusInUI(App.Text.Showing, themesFrame: (Frame)sender,
                                   doNotSetIfContains: new[] { App.Text.Active, App.Text.Editing });
            }
        }
Ejemplo n.º 5
0
        public ThemeEditorPage()
        {
            InitializeComponent();
            _ThemeEditorPage = this;

            MakeThemeUIEditable();
            UpdateText();

            //Trigger the first border mouse down event to make it the selected border
            var mouseDownEvent =
                new MouseButtonEventArgs(Mouse.PrimaryDevice, (int)DateTime.Now.Ticks, MouseButton.Left)
            {
                RoutedEvent = MouseDownEvent,
                Source      = this
            };

            borderColour1.RaiseEvent(mouseDownEvent);
        }