Beispiel #1
0
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        if (IsEditing)
        {
            MainBorder.Background      = TryFindResource("Vector.Pen") as Brush;
            TypeTextBlock.Text         = LocalizationHelper.Get("S.Edit");
            TypeComboBox.SelectedIndex = (int)(CurrentPreset?.Type ?? UploadDestinations.NotDefined);
            TypeComboBox.IsEnabled     = false;
            EnabledCheckBox.Visibility = Visibility.Visible;

            TypeComboBox.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
        }
        else
        {
            //If the file type is set, only display services that supports upload for that.
            if (Type.HasValue)
            {
                FilterRun.Text = $"\n(*.{Type.ToString().ToLower()})";

                if (!ImgurPresetItem.AllowedTypes.Contains(Type.Value))
                {
                    TypeComboBox.Items.Remove(ImgurPresetItem);
                }

                if (!GfycatPresetItem.AllowedTypes.Contains(Type.Value))
                {
                    TypeComboBox.Items.Remove(GfycatPresetItem);
                }
            }

            TypeComboBox.Focus();
        }
    }
Beispiel #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            TypeComboBox.Focus();

            if (IsEditing)
            {
                MainViewbox.Child          = TryFindResource("Vector.Pen") as Canvas;
                TypeTextBlock.Text         = LocalizationHelper.Get("S.Edit");
                TypeComboBox.SelectedIndex = (int)(CurrentTask?.TaskType ?? DefaultTaskModel.TaskTypeEnum.NotDeclared);
                TypeComboBox.IsEnabled     = false;

                TypeComboBox.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
            }
        }
Beispiel #3
0
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        TypeComboBox.Focus();

        if (IsEditing)
        {
            MainBorder.Background      = TryFindResource("Vector.Pen") as Brush;
            TypeTextBlock.Text         = LocalizationHelper.Get("S.Edit");
            TypeComboBox.SelectedIndex = (int)(CurrentTask?.TaskType ?? TaskTypes.NotDeclared);
            TypeComboBox.IsEnabled     = false;
            EnabledCheckBox.Visibility = Visibility.Visible;

            TypeComboBox.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
        }
    }