From 9b4258a9926f3bf67d4573526d496b077ec9b7c9 Mon Sep 17 00:00:00 2001 From: XceedBoucherS Date: Thu, 11 Jun 2026 07:33:59 -0400 Subject: [PATCH] V5.1.0 Released --- .../Properties/AssemblyInfo.cs | 2 +- .../Theme.xaml | 117 ++- .../Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Xceed.Wpf.AvalonDock/DockingManager.cs | 8 + .../Layout/LayoutContent.cs | 37 +- .../Properties/AssemblyInfo.cs | 2 +- .../Xceed.Wpf.AvalonDock/Themes/Default.xaml | 115 ++- .../Xceed.Wpf.AvalonDock.NET5.csproj | 3 - .../Xceed.Wpf.AvalonDock.csproj | 3 - .../Xceed.Wpf.Toolkit.LiveExplorer/App.xaml | 2 +- .../App.xaml.cs | 2 +- .../Xceed.Wpf.Toolkit.LiveExplorer/CodeBox.cs | 2 +- .../AutoSelectTextboxView.xaml.cs.txt | 2 +- .../CodeFiles/AutoSelectTextboxView.xaml.txt | 2 +- .../AvalonDockPropertiesView.xaml.cs.txt | 2 +- .../AvalonDockPropertiesView.xaml.txt | 2 +- .../AvalonDockSourcesView.xaml.cs.txt | 2 +- .../CodeFiles/AvalonDockSourcesView.xaml.txt | 2 +- .../CodeFiles/AvalonDockView.xaml.cs.txt | 2 +- .../CodeFiles/AvalonDockView.xaml.txt | 2 +- ...catorCustomContentTemplateView.xaml.cs.txt | 2 +- ...ndicatorCustomContentTemplateView.xaml.txt | 2 +- ...BusyIndicatorCustomContentView.xaml.cs.txt | 2 +- .../BusyIndicatorCustomContentView.xaml.txt | 2 +- .../CodeFiles/BusyIndicatorView.xaml.cs.txt | 2 +- .../CodeFiles/BusyIndicatorView.xaml.txt | 2 +- .../CodeFiles/ButtonSpinnerView.xaml.cs.txt | 2 +- .../CodeFiles/ButtonSpinnerView.xaml.txt | 2 +- .../CodeFiles/CalculatorView.xaml.cs.txt | 2 +- .../CodeFiles/CalculatorView.xaml.txt | 2 +- .../CodeFiles/ChartAxisView.xaml.cs.txt | 2 +- .../CodeFiles/ChartAxisView.xaml.txt | 2 +- .../CodeFiles/ChartLegendView.xaml.cs.txt | 2 +- .../CodeFiles/ChartLegendView.xaml.txt | 2 +- .../ChartSeriesBasicTypesView.xaml.cs.txt | 2 +- .../ChartSeriesBasicTypesView.xaml.txt | 2 +- ...artSeriesDataPointsBindingView.xaml.cs.txt | 2 +- .../ChartSeriesDataPointsBindingView.xaml.txt | 2 +- .../ChartStylingAxesGridView.xaml.cs.txt | 2 +- .../ChartStylingAxesGridView.xaml.txt | 2 +- .../ChartStylingColumnSeriesView.xaml.cs.txt | 2 +- .../ChartStylingColumnSeriesView.xaml.txt | 2 +- .../ChartStylingLineSeriesView.xaml.cs.txt | 2 +- .../ChartStylingLineSeriesView.xaml.txt | 2 +- .../ChartStylingPieSeriesView.xaml.cs.txt | 2 +- .../ChartStylingPieSeriesView.xaml.txt | 2 +- .../CodeFiles/CheckListsView.xaml.cs.txt | 2 +- .../CodeFiles/CheckListsView.xaml.txt | 88 ++- .../CodeFiles/ChildWindowView.xaml.cs.txt | 2 +- .../CodeFiles/ChildWindowView.xaml.txt | 2 +- .../CodeFiles/ColorView.xaml.cs.txt | 2 +- .../CodeFiles/ColorView.xaml.txt | 2 +- .../CodeFiles/DataGridView.xaml.cs.txt | 2 +- .../CodeFiles/DataGridView.xaml.txt | 2 +- .../CodeFiles/DateTimeView.xaml.cs.txt | 2 +- .../CodeFiles/DateTimeView.xaml.txt | 13 +- .../DropDownSplitButtonView.xaml.cs.txt | 2 +- .../DropDownSplitButtonView.xaml.txt | 2 +- .../CodeFiles/ExtTabControlView.xaml.cs.txt | 2 +- .../CodeFiles/ExtTabControlView.xaml.txt | 2 +- .../CodeFiles/FilePickerView.xaml.cs.txt | 2 +- .../CodeFiles/FilePickerView.xaml.txt | 2 +- .../CodeFiles/IconButtonView.xaml.cs.txt | 2 +- .../CodeFiles/IconButtonView.xaml.txt | 2 +- .../CodeFiles/ListBoxView.xaml.cs.txt | 2 +- .../CodeFiles/ListBoxView.xaml.txt | 2 +- .../CodeFiles/MagnifierView.xaml.cs.txt | 2 +- .../CodeFiles/MagnifierView.xaml.txt | 2 +- .../CodeFiles/MaskedTextboxView.xaml.cs.txt | 2 +- .../CodeFiles/MaskedTextboxView.xaml.txt | 2 +- .../CodeFiles/MaterialButtonView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialButtonView.xaml.txt | 2 +- .../MaterialCheckBoxView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialCheckBoxView.xaml.txt | 2 +- .../MaterialComboBoxView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialComboBoxView.xaml.txt | 2 +- .../MaterialControlsView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialControlsView.xaml.txt | 2 +- .../MaterialDropDownView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialDropDownView.xaml.txt | 2 +- .../CodeFiles/MaterialFrameView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialFrameView.xaml.txt | 2 +- .../MaterialHamburgerView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialHamburgerView.xaml.txt | 2 +- .../CodeFiles/MaterialListBoxView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialListBoxView.xaml.txt | 2 +- ...aterialProgressBarCircularView.xaml.cs.txt | 2 +- .../MaterialProgressBarCircularView.xaml.txt | 2 +- .../MaterialProgressBarView.xaml.cs.txt | 2 +- .../MaterialProgressBarView.xaml.txt | 2 +- .../MaterialRadioButtonView.xaml.cs.txt | 2 +- .../MaterialRadioButtonView.xaml.txt | 2 +- .../CodeFiles/MaterialSliderView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialSliderView.xaml.txt | 2 +- .../CodeFiles/MaterialSwitchView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialSwitchView.xaml.txt | 2 +- .../CodeFiles/MaterialTabsView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialTabsView.xaml.txt | 2 +- .../MaterialTextFieldView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialTextFieldView.xaml.txt | 2 +- .../CodeFiles/MaterialToastView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialToastView.xaml.txt | 2 +- .../CodeFiles/MaterialToolTipView.xaml.cs.txt | 2 +- .../CodeFiles/MaterialToolTipView.xaml.txt | 2 +- .../CodeFiles/MultiCalendarView.xaml.cs.txt | 2 +- .../CodeFiles/MultiCalendarView.xaml.txt | 2 +- .../MultiColumnComboBoxView.xaml.cs.txt | 2 +- .../MultiColumnComboBoxView.xaml.txt | 2 +- .../MultiLineTextEditorView.xaml.cs.txt | 2 +- .../MultiLineTextEditorView.xaml.txt | 2 +- .../CodeFiles/NumericView.xaml.cs.txt | 2 +- .../CodeFiles/NumericView.xaml.txt | 2 +- .../CodeFiles/PieChartView.xaml.cs.txt | 2 +- .../CodeFiles/PieChartView.xaml.txt | 2 +- .../CodeFiles/PieProgressView.xaml.cs.txt | 2 +- .../CodeFiles/PieProgressView.xaml.txt | 2 +- .../CodeFiles/PieView.xaml.cs.txt | 2 +- .../CodeFiles/PieView.xaml.txt | 2 +- .../CodeFiles/PileFlowPanelView.xaml.cs.txt | 2 +- .../CodeFiles/PileFlowPanelView.xaml.txt | 2 +- ...rtyGridAdvancedContextMenuView.xaml.cs.txt | 2 +- .../PropertyGridAttributesView.xaml.cs.txt | 2 +- .../PropertyGridAttributesView.xaml.txt | 2 +- ...opertyGridBindingToStructsView.xaml.cs.txt | 2 +- .../PropertyGridBindingToStructsView.xaml.txt | 2 +- .../PropertyGridCategoryOrderView.xaml.cs.txt | 2 +- .../PropertyGridCategoryOrderView.xaml.txt | 2 +- .../PropertyGridCustomEditorsView.xaml.cs.txt | 2 +- .../PropertyGridCustomEditorsView.xaml.txt | 2 +- ...PropertyGridCustomPropertyView.xaml.cs.txt | 2 +- .../PropertyGridCustomPropertyView.xaml.txt | 2 +- ...PropertyGridDefaultEditorsView.xaml.cs.txt | 2 +- .../PropertyGridDefaultEditorsView.xaml.txt | 2 +- .../PropertyGridDefinitionKeyView.xaml.cs.txt | 2 +- .../PropertyGridDefinitionKeyView.xaml.txt | 2 +- ...rtyGridDisplayLocalizationView.xaml.cs.txt | 2 +- ...opertyGridDisplayLocalizationView.xaml.txt | 2 +- ...orComboBoxDefinitionSourceView.xaml.cs.txt | 2 +- ...ditorComboBoxDefinitionSourceView.xaml.txt | 2 +- ...pertyGridEditorDefinitionsView.xaml.cs.txt | 2 +- ...PropertyGridEditorDefinitionsView.xaml.txt | 2 +- ...GridExpandingNonPrimitivesView.xaml.cs.txt | 2 +- ...rtyGridExpandingNonPrimitivesView.xaml.txt | 2 +- ...tyGridMultiSelectedObjectsView.xaml.cs.txt | 2 +- ...pertyGridMultiSelectedObjectsView.xaml.txt | 2 +- ...opertyGridPropertiesSourceView.xaml.cs.txt | 2 +- .../PropertyGridPropertiesSourceView.xaml.txt | 2 +- .../PropertyGridPropertiesView.xaml.cs.txt | 2 +- .../PropertyGridPropertiesView.xaml.txt | 2 +- ...pertyGridPropertyItemStyleView.xaml.cs.txt | 2 +- ...PropertyGridPropertyItemStyleView.xaml.txt | 2 +- ...PropertyGridSelectedObjectView.xaml.cs.txt | 2 +- .../PropertyGridSelectedObjectView.xaml.txt | 2 +- ...tyGridSpecifyingPropertiesView.xaml.cs.txt | 2 +- ...pertyGridSpecifyingPropertiesView.xaml.txt | 2 +- .../CodeFiles/PropertyGridView.xaml.cs.txt | 2 +- .../CodeFiles/PropertyGridView.xaml.txt | 2 +- .../CodeFiles/RadialGaugeView.xaml.cs.txt | 2 +- .../CodeFiles/RadialGaugeView.xaml.txt | 2 +- .../CodeFiles/RangeSliderView.xaml.cs.txt | 2 +- .../CodeFiles/RangeSliderView.xaml.txt | 2 +- .../CodeFiles/RatingView.xaml.cs.txt | 2 +- .../CodeFiles/RatingView.xaml.txt | 2 +- .../CodeFiles/RichTextboxView.xaml.cs.txt | 3 +- .../CodeFiles/RichTextboxView.xaml.txt | 177 +++-- .../CodeFiles/SlideShowView.xaml.cs.txt | 2 +- .../CodeFiles/SlideShowView.xaml.txt | 2 +- .../CodeFiles/StyleableWindowView.xaml.cs.txt | 2 +- .../CodeFiles/StyleableWindowView.xaml.txt | 2 +- .../CodeFiles/SwitchPanelView.xaml.cs.txt | 2 +- .../CodeFiles/SwitchPanelView.xaml.txt | 2 +- .../ThemingAvalonDockView.xaml.cs.txt | 2 +- .../CodeFiles/ThemingAvalonDockView.xaml.txt | 2 +- .../CodeFiles/ThemingCoreWPFView.xaml.cs.txt | 2 +- .../CodeFiles/ThemingCoreWPFView.xaml.txt | 2 +- .../CodeFiles/ThemingDataGridView.xaml.cs.txt | 2 +- .../CodeFiles/ThemingDataGridView.xaml.txt | 2 +- .../ThemingExtendedToolkitView.xaml.cs.txt | 2 +- .../ThemingExtendedToolkitView.xaml.txt | 2 +- .../CodeFiles/ThemingListBoxView.xaml.cs.txt | 2 +- .../CodeFiles/ThemingListBoxView.xaml.txt | 2 +- .../CodeFiles/TimeSpanView.xaml.cs.txt | 2 +- .../CodeFiles/TimeSpanView.xaml.txt | 2 +- .../CodeFiles/TimelinePanelView.xaml.cs.txt | 2 +- .../CodeFiles/TimelinePanelView.xaml.txt | 2 +- .../CodeFiles/ToggleSwitchView.xaml.cs.txt | 2 +- .../CodeFiles/ToggleSwitchView.xaml.txt | 2 +- .../TokenizedTextBoxView.xaml.cs.txt | 2 +- .../CodeFiles/TokenizedTextBoxView.xaml.txt | 2 +- .../WatermarkComboBoxView.xaml.cs.txt | 2 +- .../CodeFiles/WatermarkComboBoxView.xaml.txt | 2 +- .../WatermarkPasswordBoxView.xaml.cs.txt | 2 +- .../WatermarkPasswordBoxView.xaml.txt | 2 +- .../WatermarkTextboxView.xaml.cs.txt | 2 +- .../CodeFiles/WatermarkTextboxView.xaml.txt | 2 +- .../CodeFiles/WindowContainerView.xaml.cs.txt | 2 +- .../CodeFiles/WindowContainerView.xaml.txt | 2 +- .../CodeFiles/WizardView.xaml.cs.txt | 2 +- .../CodeFiles/WizardView.xaml.txt | 2 +- .../CodeFiles/ZoomboxView.xaml.cs.txt | 2 +- .../CodeFiles/ZoomboxView.xaml.txt | 2 +- .../Core/CSharpFormatter.cs | 2 +- .../Core/Converters/ZeroToBoolConverter.cs | 2 +- .../Core/LiveExplorerTreeViewItem.cs | 2 +- .../Core/XamlFormatter.cs | 2 +- .../DemoView.cs | 2 +- .../HomeView.xaml | 2 +- .../HomeView.xaml.cs | 2 +- .../MainWindow.xaml | 2 +- .../MainWindow.xaml.cs | 2 +- .../Properties/AssemblyInfo.cs | 4 +- .../Resources/LiveExplorerScrollViewer.xaml | 2 +- .../Resources/TextBlockStyles.xaml | 2 +- .../Samples/AvalonDock/Resources/Document.cs | 2 +- .../AvalonDock/Resources/DocumentView.xaml | 2 +- .../AvalonDock/Resources/DocumentView.xaml.cs | 2 +- .../Samples/AvalonDock/Resources/Note.cs | 2 +- .../AvalonDock/Resources/NoteView.xaml | 2 +- .../AvalonDock/Resources/NoteView.xaml.cs | 2 +- .../Samples/AvalonDock/Resources/Page.cs | 2 +- .../AvalonDock/Resources/PageView.xaml | 2 +- .../AvalonDock/Resources/PageView.xaml.cs | 2 +- .../Views/AvalonDockPropertiesView.xaml | 2 +- .../Views/AvalonDockPropertiesView.xaml.cs | 2 +- .../Views/AvalonDockSourcesView.xaml | 2 +- .../Views/AvalonDockSourcesView.xaml.cs | 2 +- .../AvalonDock/Views/AvalonDockView.xaml | 2 +- .../AvalonDock/Views/AvalonDockView.xaml.cs | 2 +- .../Converters/IntegerToTimespanConverter.cs | 2 +- .../BusyIndicator/Resources/Common.xaml | 2 +- ...usyIndicatorCustomContentTemplateView.xaml | 2 +- ...IndicatorCustomContentTemplateView.xaml.cs | 2 +- .../Views/BusyIndicatorCustomContentView.xaml | 2 +- .../BusyIndicatorCustomContentView.xaml.cs | 2 +- .../Views/BusyIndicatorView.xaml | 2 +- .../Views/BusyIndicatorView.xaml.cs | 2 +- .../Button/Views/ButtonSpinnerView.xaml | 2 +- .../Button/Views/ButtonSpinnerView.xaml.cs | 2 +- .../Button/Views/DropDownSplitButtonView.xaml | 2 +- .../Views/DropDownSplitButtonView.xaml.cs | 2 +- .../Samples/Button/Views/IconButtonView.xaml | 2 +- .../Button/Views/IconButtonView.xaml.cs | 2 +- .../Calculator/Views/CalculatorView.xaml | 2 +- .../Calculator/Views/CalculatorView.xaml.cs | 2 +- .../GraduationModeToComboBoxConverter.cs | 2 +- .../Samples/Chart/Views/ChartAxisView.xaml | 2 +- .../Samples/Chart/Views/ChartAxisView.xaml.cs | 2 +- .../Samples/Chart/Views/ChartLegendView.xaml | 2 +- .../Chart/Views/ChartLegendView.xaml.cs | 2 +- .../Views/ChartSeriesBasicTypesView.xaml | 2 +- .../Views/ChartSeriesBasicTypesView.xaml.cs | 2 +- .../ChartSeriesDataPointsBindingView.xaml | 2 +- .../ChartSeriesDataPointsBindingView.xaml.cs | 2 +- .../Chart/Views/ChartStylingAxesGridView.xaml | 2 +- .../Views/ChartStylingAxesGridView.xaml.cs | 2 +- .../Views/ChartStylingColumnSeriesView.xaml | 2 +- .../ChartStylingColumnSeriesView.xaml.cs | 2 +- .../Views/ChartStylingLineSeriesView.xaml | 2 +- .../Views/ChartStylingLineSeriesView.xaml.cs | 2 +- .../Views/ChartStylingPieSeriesView.xaml | 2 +- .../Views/ChartStylingPieSeriesView.xaml.cs | 2 +- .../CheckLists/Views/CheckListsView.xaml | 60 +- .../CheckLists/Views/CheckListsView.xaml.cs | 2 +- .../Samples/Color/Views/ColorView.xaml | 2 +- .../Samples/Color/Views/ColorView.xaml.cs | 2 +- .../DataGrid/Converters/FlagPathConverter.cs | 2 +- .../Samples/DataGrid/Views/DataGridView.xaml | 2 +- .../DataGrid/Views/DataGridView.xaml.cs | 2 +- .../Views/MultiColumnComboBoxView.xaml | 2 +- .../Views/MultiColumnComboBoxView.xaml.cs | 2 +- .../Converters/CustomFormatToBoolConverter.cs | 2 +- .../Converters/DateTimeToTimeSpanConverter.cs | 2 +- .../Samples/DateTime/Views/DateTimeView.xaml | 12 +- .../DateTime/Views/DateTimeView.xaml.cs | 2 +- .../Views/ExtTabControlView.xaml | 2 +- .../Views/ExtTabControlView.xaml.cs | 2 +- .../FilePicker/Views/FilePickerView.xaml | 2 +- .../FilePicker/Views/FilePickerView.xaml.cs | 2 +- .../Samples/Gauge/Views/RadialGaugeView.xaml | 2 +- .../Gauge/Views/RadialGaugeView.xaml.cs | 2 +- .../Converters/BoxArtImageSourceConverter.cs | 2 +- .../Samples/ListBox/Views/ListBoxView.xaml | 2 +- .../Samples/ListBox/Views/ListBoxView.xaml.cs | 2 +- .../Magnifier/Converters/ColorConverter.cs | 2 +- .../Converters/VisibilityConverter.cs | 2 +- .../Magnifier/Views/MagnifierView.xaml | 2 +- .../Magnifier/Views/MagnifierView.xaml.cs | 2 +- .../Converters/EqualsMinusOneConverter.cs | 2 +- .../MaterialControls/Data/RequiredRule.cs | 2 +- .../Resources/CommonResources.xaml | 2 +- .../Views/MaterialButtonView.xaml | 2 +- .../Views/MaterialButtonView.xaml.cs | 2 +- .../Views/MaterialCheckBoxView.xaml | 2 +- .../Views/MaterialCheckBoxView.xaml.cs | 2 +- .../Views/MaterialComboBoxView.xaml | 2 +- .../Views/MaterialComboBoxView.xaml.cs | 2 +- .../Views/MaterialControlsView.xaml | 2 +- .../Views/MaterialControlsView.xaml.cs | 2 +- .../Views/MaterialDemoView.cs | 2 +- .../Views/MaterialDropDownView.xaml | 2 +- .../Views/MaterialDropDownView.xaml.cs | 2 +- .../Views/MaterialFrameView.xaml | 2 +- .../Views/MaterialFrameView.xaml.cs | 2 +- .../Views/MaterialHamburgerView.xaml | 2 +- .../Views/MaterialHamburgerView.xaml.cs | 2 +- .../Views/MaterialListBoxView.xaml | 2 +- .../Views/MaterialListBoxView.xaml.cs | 2 +- .../MaterialProgressBarCircularView.xaml | 2 +- .../MaterialProgressBarCircularView.xaml.cs | 2 +- .../Views/MaterialProgressBarView.xaml | 2 +- .../Views/MaterialProgressBarView.xaml.cs | 2 +- .../Views/MaterialRadioButtonView.xaml | 2 +- .../Views/MaterialRadioButtonView.xaml.cs | 2 +- .../Views/MaterialSliderView.xaml | 2 +- .../Views/MaterialSliderView.xaml.cs | 2 +- .../Views/MaterialSwitchView.xaml | 2 +- .../Views/MaterialSwitchView.xaml.cs | 2 +- .../Views/MaterialTabsView.xaml | 2 +- .../Views/MaterialTabsView.xaml.cs | 2 +- .../Views/MaterialTextFieldView.xaml | 2 +- .../Views/MaterialTextFieldView.xaml.cs | 2 +- .../Views/MaterialToastView.xaml | 2 +- .../Views/MaterialToastView.xaml.cs | 2 +- .../Views/MaterialToolTipView.xaml | 2 +- .../Views/MaterialToolTipView.xaml.cs | 2 +- .../Views/MultiCalendarView.xaml | 2 +- .../Views/MultiCalendarView.xaml.cs | 2 +- .../Samples/Numeric/Views/NumericView.xaml | 2 +- .../Samples/Numeric/Views/NumericView.xaml.cs | 2 +- .../ComboBoxToVisibilityConverter.cs | 2 +- .../Samples/Panels/Views/SwitchPanelView.xaml | 2 +- .../Panels/Views/SwitchPanelView.xaml.cs | 2 +- .../Pie/Converters/SliceLabelConverter.cs | 2 +- .../Samples/Pie/Views/PieChartView.xaml | 2 +- .../Samples/Pie/Views/PieChartView.xaml.cs | 2 +- .../Samples/Pie/Views/PieProgressView.xaml | 2 +- .../Samples/Pie/Views/PieProgressView.xaml.cs | 2 +- .../Samples/Pie/Views/PieView.xaml | 2 +- .../Samples/Pie/Views/PieView.xaml.cs | 2 +- .../Converters/FullNameStringConverter.cs | 2 +- .../Views/PileFlowPanelView.xaml | 2 +- .../Views/PileFlowPanelView.xaml.cs | 2 +- .../Converters/DimensionConverter.cs | 2 +- .../Resources/LastNameUserControlEditor.xaml | 2 +- .../LastNameUserControlEditor.xaml.cs | 2 +- ...ropertyGridAdvancedContextMenuView.xaml.cs | 2 +- .../Views/PropertyGridAttributesView.xaml | 2 +- .../Views/PropertyGridAttributesView.xaml.cs | 2 +- .../PropertyGridBindingToStructsView.xaml | 2 +- .../PropertyGridBindingToStructsView.xaml.cs | 2 +- .../Views/PropertyGridCategoryOrderView.xaml | 2 +- .../PropertyGridCategoryOrderView.xaml.cs | 2 +- .../Views/PropertyGridCustomEditorsView.xaml | 2 +- .../PropertyGridCustomEditorsView.xaml.cs | 2 +- .../Views/PropertyGridCustomPropertyView.xaml | 2 +- .../PropertyGridCustomPropertyView.xaml.cs | 2 +- .../Views/PropertyGridDefaultEditorsView.xaml | 2 +- .../PropertyGridDefaultEditorsView.xaml.cs | 2 +- .../Views/PropertyGridDefinitionKeyView.xaml | 2 +- .../PropertyGridDefinitionKeyView.xaml.cs | 2 +- .../PropertyGridDisplayLocalizationView.xaml | 2 +- ...ropertyGridDisplayLocalizationView.xaml.cs | 2 +- ...ridEditorComboBoxDefinitionSourceView.xaml | 2 +- ...EditorComboBoxDefinitionSourceView.xaml.cs | 2 +- .../PropertyGridEditorDefinitionsView.xaml | 2 +- .../PropertyGridEditorDefinitionsView.xaml.cs | 2 +- ...ropertyGridExpandingNonPrimitivesView.xaml | 2 +- ...ertyGridExpandingNonPrimitivesView.xaml.cs | 2 +- .../PropertyGridMultiSelectedObjectsView.xaml | 2 +- ...opertyGridMultiSelectedObjectsView.xaml.cs | 2 +- .../PropertyGridPropertiesSourceView.xaml | 2 +- .../PropertyGridPropertiesSourceView.xaml.cs | 2 +- .../Views/PropertyGridPropertiesView.xaml | 2 +- .../Views/PropertyGridPropertiesView.xaml.cs | 2 +- .../PropertyGridPropertyItemStyleView.xaml | 2 +- .../PropertyGridPropertyItemStyleView.xaml.cs | 2 +- .../Views/PropertyGridSelectedObjectView.xaml | 2 +- .../PropertyGridSelectedObjectView.xaml.cs | 2 +- .../PropertyGridSpecifyingPropertiesView.xaml | 2 +- ...opertyGridSpecifyingPropertiesView.xaml.cs | 2 +- .../PropertyGrid/Views/PropertyGridView.xaml | 2 +- .../Views/PropertyGridView.xaml.cs | 2 +- .../Converters/AbsoluteAdditionConverter.cs | 2 +- .../Converters/RangeSliderEnabledConverter.cs | 2 +- .../RangeSlider/Views/RangeSliderView.xaml | 2 +- .../RangeSlider/Views/RangeSliderView.xaml.cs | 2 +- .../Samples/Rating/Views/RatingView.xaml | 2 +- .../Samples/Rating/Views/RatingView.xaml.cs | 2 +- .../SlideShow/Views/SlideShowView.xaml | 2 +- .../SlideShow/Views/SlideShowView.xaml.cs | 2 +- .../Text/Views/AutoSelectTextboxView.xaml | 2 +- .../Text/Views/AutoSelectTextboxView.xaml.cs | 2 +- .../Samples/Text/Views/MaskedTextboxView.xaml | 2 +- .../Text/Views/MaskedTextboxView.xaml.cs | 2 +- .../Text/Views/MultiLineTextEditorView.xaml | 2 +- .../Views/MultiLineTextEditorView.xaml.cs | 2 +- .../Samples/Text/Views/RichTextboxView.xaml | 144 ++-- .../Text/Views/RichTextboxView.xaml.cs | 3 +- .../Text/Views/TokenizedTextBoxView.xaml | 2 +- .../Text/Views/TokenizedTextBoxView.xaml.cs | 2 +- .../Text/Views/WatermarkPasswordBoxView.xaml | 2 +- .../Views/WatermarkPasswordBoxView.xaml.cs | 2 +- .../Text/Views/WatermarkTextboxView.xaml | 2 +- .../Text/Views/WatermarkTextboxView.xaml.cs | 2 +- .../Theming/Converters/FlagPathConverter.cs | 2 +- .../Samples/Theming/ItemTemplates/Common.xaml | 2 +- .../Theming/Views/ThemingAvalonDockView.xaml | 2 +- .../Views/ThemingAvalonDockView.xaml.cs | 2 +- .../Theming/Views/ThemingCoreWPFView.xaml | 2 +- .../Theming/Views/ThemingCoreWPFView.xaml.cs | 2 +- .../Theming/Views/ThemingDataGridView.xaml | 2 +- .../Theming/Views/ThemingDataGridView.xaml.cs | 2 +- .../Views/ThemingExtendedToolkitView.xaml | 2 +- .../Views/ThemingExtendedToolkitView.xaml.cs | 2 +- .../Theming/Views/ThemingListBoxView.xaml | 2 +- .../Theming/Views/ThemingListBoxView.xaml.cs | 2 +- .../Samples/TimeSpan/Views/TimeSpanView.xaml | 2 +- .../TimeSpan/Views/TimeSpanView.xaml.cs | 2 +- .../Views/TimelinePanelView.xaml | 2 +- .../Views/TimelinePanelView.xaml.cs | 2 +- .../ToggleSwitch/Views/ToggleSwitchView.xaml | 2 +- .../Views/ToggleSwitchView.xaml.cs | 2 +- .../Views/WatermarkComboBoxView.xaml | 2 +- .../Views/WatermarkComboBoxView.xaml.cs | 2 +- .../Window/Converters/IntToBoolConverter.cs | 2 +- .../Converters/WindowStateToBoolConverter.cs | 2 +- .../Samples/Window/Resources/FancyStyles.xaml | 2 +- .../Window/Resources/WindowModelEditor.xaml | 2 +- .../Resources/WindowModelEditor.xaml.cs | 2 +- .../Samples/Window/Views/ChildWindowView.xaml | 2 +- .../Window/Views/ChildWindowView.xaml.cs | 2 +- .../Window/Views/StyleableWindowView.xaml | 2 +- .../Window/Views/StyleableWindowView.xaml.cs | 2 +- .../Window/Views/WindowContainerView.xaml | 2 +- .../Window/Views/WindowContainerView.xaml.cs | 2 +- .../Samples/Wizard/Views/WizardView.xaml | 2 +- .../Samples/Wizard/Views/WizardView.xaml.cs | 2 +- .../Zoombox/Converters/PointConverter.cs | 2 +- .../Zoombox/Converters/RectConverter.cs | 2 +- .../Zoombox/Converters/SimpleConverter.cs | 2 +- .../Zoombox/Converters/ViewFinderConverter.cs | 2 +- .../Zoombox/Converters/ViewNameConverter.cs | 2 +- .../Converters/ViewStackCountConverter.cs | 2 +- .../Samples/Zoombox/Views/ZoomboxView.xaml | 2 +- .../Samples/Zoombox/Views/ZoomboxView.xaml.cs | 2 +- ...Xceed.Wpf.Toolkit.LiveExplorer.NET5.csproj | 12 + .../Xceed.Wpf.Toolkit.LiveExplorer.csproj | 12 + .../Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs | 4 +- .../Implementation/ButtonSpinner.cs | 19 + .../Themes/Aero2.NormalColor.xaml | 12 +- .../ButtonSpinner/Themes/Generic.xaml | 11 +- .../Themes/Aero2.NormalColor.xaml | 10 +- .../CalculatorUpDown/Themes/Generic.xaml | 10 +- .../Implementation/CheckComboBox.cs | 33 +- .../Themes/Aero2.NormalColor.xaml | 7 +- .../CheckComboBox/Themes/Generic.xaml | 31 +- .../Themes/Aero2.NormalColor.xaml | 2 - .../CollectionControlDialog.xaml.cs | 4 +- .../ColorPicker/Implementation/ColorPicker.cs | 29 + .../ColorPicker/Themes/Aero2.NormalColor.xaml | 26 +- .../ColorPicker/Themes/Generic.xaml | 34 +- .../Core/AppearanceProperties.cs | 113 +++ .../CornerRadiusReplacementConverter.cs | 151 ++++ .../Implementation/DateTimePicker.cs | 17 + .../Themes/Aero2.NormalColor.xaml | 15 +- .../DateTimePicker/Themes/Generic.xaml | 15 +- .../Implementation/DateTimeParser.cs | 4 + .../Themes/Aero2.NormalColor.xaml | 240 +++--- .../DateTimeUpDown/Themes/Generic.xaml | 239 +++--- .../Implementation/DropDownButton.cs | 30 + .../Themes/Aero2.NormalColor.xaml | 2 + .../DropDownButton/Themes/Generic.xaml | 4 +- .../Implementation/MaskedTextBox.cs | 19 +- .../Themes/Aero2.NormalColor.xaml | 94 ++- .../MaskedTextBox/Themes/Generic.xaml | 94 ++- .../MaskedTextBox/Themes/HighContrast.xaml | 94 ++- .../Themes/Aero2.NormalColor.xaml | 7 +- .../NumericUpDown/Themes/Generic.xaml | 8 +- .../Implementation/MaskedTextBox.cs | 721 ------------------ .../Xceed.Wpf.Toolkit/Primitives/InputBase.cs | 29 + .../Primitives/SelectAllSelector.cs | 34 + .../Xceed.Wpf.Toolkit/Primitives/Selector.cs | 1 + .../Themes/Aero2/WindowControl.xaml | 4 +- .../Themes/Generic/WindowControl.xaml | 4 +- .../Primitives/WindowContainer.cs | 3 - .../Properties/AssemblyInfo.cs | 2 +- .../Editors/CollectionEditor.cs | 2 + .../Implementation/PropertyItem.cs | 19 +- .../RichTextBox/Formatters/RtfFormatter.cs | 4 +- .../RichTextBoxFormatBar.cs | 290 +++---- .../RichTextBoxFormatBarManager.cs | 207 +++-- .../Themes/Aero/Buttons_NormalColor.xaml | 61 +- .../Themes/Aero2/Buttons.xaml | 61 +- .../Themes/Generic/Buttons.xaml | 55 +- .../TimePicker/Themes/Aero2.NormalColor.xaml | 17 +- .../TimePicker/Themes/Generic.xaml | 17 +- .../Themes/Aero2.NormalColor.xaml | 259 +++---- .../TimeSpanUpDown/Themes/Generic.xaml | 237 +++--- .../Utils/Licensing/LicenseOrigin.cs | 35 - .../Implementation/WatermarkComboBox.cs | 17 + .../Themes/Aero2.NormalColor.xaml | 6 +- .../WatermarkComboBox/Themes/Generic.xaml | 4 + .../Implementation/WatermarkTextBox.cs | 18 + .../Themes/Aero2.NormalColor.xaml | 27 +- .../WatermarkTextBox/Themes/Generic.xaml | 26 +- .../Xceed.Wpf.Toolkit.NET5.csproj | 4 +- .../Xceed.Wpf.Toolkit.csproj | 4 +- 508 files changed, 2846 insertions(+), 2373 deletions(-) create mode 100644 ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/AppearanceProperties.cs create mode 100644 ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/CornerRadiusReplacementConverter.cs delete mode 100644 ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Obselete/MaskedTextBox/Implementation/MaskedTextBox.cs delete mode 100644 ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Utils/Licensing/LicenseOrigin.cs diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Properties/AssemblyInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Properties/AssemblyInfo.cs index 0b939ab2..01a5795a 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Properties/AssemblyInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System; [assembly: AssemblyCompany( "Xceed Software Inc." )] [assembly: AssemblyProduct( "Xceed Toolkit for WPF - AvalonDock" )] -[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2025" )] +[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2026" )] diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml index b8f64b4f..64d522ec 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml @@ -47,6 +47,97 @@ + + + + + + + - diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs index f2afe8dc..d7d89cc6 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs @@ -232,9 +232,7 @@ namespace Xceed.Wpf.Toolkit Debug.Assert( result != null ); if( result != null ) { - PropertyInfo[] propertyInfos = typeof( ICollection ).IsAssignableFrom( sourceType ) - ? sourceType.GetProperties( BindingFlags.Instance | BindingFlags.Public ) - : sourceType.GetProperties( BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly ); + PropertyInfo[] propertyInfos = sourceType.GetProperties( BindingFlags.Instance | BindingFlags.Public ); foreach( var propertyInfo in propertyInfos ) { diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs index 5940f037..1536a71f 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs @@ -657,6 +657,35 @@ namespace Xceed.Wpf.Toolkit #endregion //UsingAlphaChannel + #region CornerRadius + + public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register( nameof( CornerRadius ), typeof( CornerRadius ), typeof( ColorPicker ), new FrameworkPropertyMetadata( new CornerRadius(), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback( OnCornerRadiusPropertyChanged ) ) ); + public CornerRadius CornerRadius + { + get + { + return ( CornerRadius )GetValue( CornerRadiusProperty ); + } + set + { + SetValue( CornerRadiusProperty, value ); + } + } + + private static void OnCornerRadiusPropertyChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + ColorPicker colorPicker = ( ColorPicker )d; + if( colorPicker != null ) + colorPicker.OnCornerRadiusChanged(); + } + + protected virtual void OnCornerRadiusChanged() + { + } + + #endregion //CornerRadius + + #endregion //Properties #region Constructors diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml index 5fda4800..737bd595 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml @@ -19,6 +19,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Xceed.Wpf.Toolkit" xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters" + xmlns:core="clr-namespace:Xceed.Wpf.Toolkit.Core" xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"> @@ -133,8 +134,10 @@ - @@ -147,7 +150,7 @@ + + + + VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" /> @@ -296,15 +305,17 @@ + Value="AliceBlue" /> + Value="{StaticResource PanelBackgroundBrush}" /> + + Value="#FFF0F0F0" /> @@ -320,7 +331,8 @@ Padding="{TemplateBinding Padding}" IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" - Style="{TemplateBinding ButtonStyle}"> + Style="{TemplateBinding ButtonStyle}" + core:AppearanceProperties.OuterCornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}}"> diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml index c709428d..a72cb9ec 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml @@ -18,6 +18,7 @@ @@ -173,8 +174,10 @@ - @@ -187,7 +190,7 @@ + + + + + StartPoint="0.5,0"> + Style="{TemplateBinding ButtonStyle}" + core:AppearanceProperties.OuterCornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}}"> @@ -379,7 +391,7 @@ BorderThickness="1" BorderBrush="#FFC9CACA" /> + VerticalAlignment="Center"> @@ -441,12 +453,12 @@ Background="{TemplateBinding HeaderBackground}" Foreground="{TemplateBinding HeaderForeground}" Padding="2" - Margin="0,0,0,1" > + Margin="0,0,0,1"> + Style="{StaticResource ColorListStyle}"> @@ -463,12 +475,12 @@ Background="{TemplateBinding HeaderBackground}" Foreground="{TemplateBinding HeaderForeground}" Padding="2" - Margin="0,1,0,1" > + Margin="0,1,0,1"> + Style="{StaticResource ColorListStyle}"> @@ -486,12 +498,12 @@ Background="{TemplateBinding HeaderBackground}" Foreground="{TemplateBinding HeaderForeground}" Padding="2" - Margin="0,1,0,1" > + Margin="0,1,0,1"> + Style="{StaticResource ColorListStyle}"> diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/AppearanceProperties.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/AppearanceProperties.cs new file mode 100644 index 00000000..1d1c32f3 --- /dev/null +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/AppearanceProperties.cs @@ -0,0 +1,113 @@ +/************************************************************************************* + + Toolkit for WPF + + Copyright (C) 2007-2025 Xceed Software Inc. + + This program is provided to you under the terms of the XCEED SOFTWARE, INC. + COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at + https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md + + For more features, controls, and fast professional support, + pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/ + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System.Windows.Media; +using System.Windows; + +namespace Xceed.Wpf.Toolkit.Core +{ + public class AppearanceProperties + { + #region OuterCornerRadiusProperty + + public static CornerRadius GetOuterCornerRadius( DependencyObject obj ) + { + return ( CornerRadius )obj.GetValue( OuterCornerRadiusProperty ); + } + + public static void SetOuterCornerRadius( DependencyObject obj, CornerRadius value ) + { + obj.SetValue( OuterCornerRadiusProperty, value ); + } + + public static readonly DependencyProperty OuterCornerRadiusProperty = + DependencyProperty.RegisterAttached( + "OuterCornerRadius", + typeof( CornerRadius ), + typeof( AppearanceProperties ), + new FrameworkPropertyMetadata( new CornerRadius( 0.0 ) ) ); + + #endregion OuterCornerRadiusProperty + + + #region ContentMarginProperty + + public static Thickness GetContentMargin( DependencyObject obj ) + { + return ( Thickness )obj.GetValue( ContentMarginProperty ); + } + + public static void SetContentMargin( DependencyObject obj, Thickness value ) + { + obj.SetValue( ContentMarginProperty, value ); + } + + public static readonly DependencyProperty ContentMarginProperty = + DependencyProperty.RegisterAttached( + "ContentMargin", + typeof( Thickness ), + typeof( AppearanceProperties ), + new FrameworkPropertyMetadata( new Thickness( 0.0 ) ) ); + + #endregion InnerBorderThicknessProperty + + + #region HeaderForegroundProperty + + public static Brush GetHeaderForeground( DependencyObject obj ) + { + return ( Brush )obj.GetValue( HeaderForegroundProperty ); + } + + public static void SetHeaderForeground( DependencyObject obj, Brush value ) + { + obj.SetValue( HeaderForegroundProperty, value ); + } + + public static readonly DependencyProperty HeaderForegroundProperty = + DependencyProperty.RegisterAttached( + "HeaderForeground", + typeof( Brush ), + typeof( AppearanceProperties ), + new FrameworkPropertyMetadata( ( Brush )( new SolidColorBrush( Colors.Black ).GetAsFrozen() ) ) ); + + #endregion HeaderForegroundProperty + + + #region HeaderFontWeightProperty + + public static FontWeight GetHeaderFontWeight( DependencyObject obj ) + { + return ( FontWeight )obj.GetValue( HeaderFontWeightProperty ); + } + + public static void SetHeaderFontWeight( DependencyObject obj, FontWeight value ) + { + obj.SetValue( HeaderFontWeightProperty, value ); + } + + public static readonly DependencyProperty HeaderFontWeightProperty = + DependencyProperty.RegisterAttached( + "HeaderFontWeight", + typeof( FontWeight ), + typeof( AppearanceProperties ), + new FrameworkPropertyMetadata( FontWeights.Normal ) ); + + #endregion HeaderFontWeightProperty + } + +} diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/CornerRadiusReplacementConverter.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/CornerRadiusReplacementConverter.cs new file mode 100644 index 00000000..c967419e --- /dev/null +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/CornerRadiusReplacementConverter.cs @@ -0,0 +1,151 @@ +/************************************************************************************* + + Toolkit for WPF + + Copyright (C) 2007-2025 Xceed Software Inc. + + This program is provided to you under the terms of the XCEED SOFTWARE, INC. + COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at + https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md + + For more features, controls, and fast professional support, + pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/ + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System.Globalization; +using System.Windows.Data; +using System.Windows.Markup; +using System.Windows; +using System; + +namespace Xceed.Wpf.Toolkit.Core.Converters +{ + public class CornerRadiusReplacementConverter : MarkupExtension, IValueConverter + { + + public const string Auto = "Auto"; + + #region Constructors + + public CornerRadiusReplacementConverter() + { + } + + public CornerRadiusReplacementConverter( + object topLeft, + object topRight, + object bottomRight, + object bottomLeft ) + { + this.TopLeft = topLeft; + this.TopRight = topRight; + this.BottomRight = bottomRight; + this.BottomLeft = bottomLeft; + } + + #endregion Constructors + + #region Properties + + public object TopLeft { get; set; } = Auto; + + public object TopRight { get; set; } = Auto; + + public object BottomRight { get; set; } = Auto; + + public object BottomLeft { get; set; } = Auto; + + #endregion Properties + + #region Implement IValueConverter + + public object Convert( object value, Type targetType, object parameter, CultureInfo culture ) + { + if( value is CornerRadius ) + { + CornerRadius source = ( CornerRadius )value; + + return new CornerRadius( + GetValue( this.TopLeft, source, source.TopLeft ), + GetValue( this.TopRight, source, source.TopRight ), + GetValue( this.BottomRight, source, source.BottomRight ), + GetValue( this.BottomLeft, source, source.BottomLeft ) ); + } + else if( value is double || value is int ) + { + CornerRadius source = new CornerRadius( System.Convert.ToDouble( value ) ); + + return new CornerRadius( + this.GetValue( this.TopLeft, source, source.TopLeft ), + this.GetValue( this.TopRight, source, source.TopRight ), + this.GetValue( this.BottomRight, source, source.BottomRight ), + this.GetValue( this.BottomLeft, source, source.BottomLeft ) ); + } + + return new CornerRadius( 0 ); + } + + public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture ) + { + throw new NotImplementedException(); + } + + #endregion Implement IValueConverter + + #region Implement MarkupExtension + + public override object ProvideValue( IServiceProvider serviceProvider ) + { + return this; + } + + #endregion Implement MarkupExtension + + #region Methods (Private) + + private double GetValue( object operand, CornerRadius sourceCornerRadius, double autoValue ) + { + var stringVal = operand as string; + if( stringVal != null ) + { + if( Auto.Equals( stringVal, StringComparison.Ordinal ) ) + { + return autoValue; + } + else if( "TopLeft".Equals( stringVal, StringComparison.Ordinal ) ) + { + return sourceCornerRadius.TopLeft; + } + else if( "TopRight".Equals( stringVal, StringComparison.Ordinal ) ) + { + return sourceCornerRadius.TopRight; + } + else if( "BottomRight".Equals( stringVal, StringComparison.Ordinal ) ) + { + return sourceCornerRadius.BottomRight; + } + else if( "BottomLeft".Equals( stringVal, StringComparison.Ordinal ) ) + { + return sourceCornerRadius.BottomLeft; + } + else if( double.TryParse( stringVal, out var doubleValue ) ) + { + return doubleValue; + } + } + else if( operand is double || operand is int ) + { + return ( double )System.Convert.ToDouble( operand ); + } + + throw new ArgumentException( "Value '" + operand + "' not recognized. Supported values are Auto, Left, Top, Right, Bottom or a double value." ); + } + + #endregion Methods (Private) + + } + +} diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs index 2abb3511..feafd790 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs @@ -51,6 +51,23 @@ namespace Xceed.Wpf.Toolkit #region Properties + #region AutoCloseCalendarOnTodayButton + + public static readonly DependencyProperty AutoCloseCalendarOnTodayButtonProperty = DependencyProperty.Register( nameof( AutoCloseCalendarOnTodayButton ), typeof( bool ), typeof( DateTimePicker ), new UIPropertyMetadata( false ) ); + public bool AutoCloseCalendarOnTodayButton + { + get + { + return ( bool )GetValue( AutoCloseCalendarOnTodayButtonProperty ); + } + set + { + SetValue( AutoCloseCalendarOnTodayButtonProperty, value ); + } + } + + #endregion //AutoCloseCalendarOnToDayButton + #region AutoCloseCalendar public static readonly DependencyProperty AutoCloseCalendarProperty = DependencyProperty.Register( "AutoCloseCalendar", typeof( bool ), typeof( DateTimePicker ), new UIPropertyMetadata( false ) ); diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml index a757e612..dddd7197 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml @@ -21,6 +21,7 @@ xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes" xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes" xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters" + xmlns:core="clr-namespace:Xceed.Wpf.Toolkit.Core" xmlns:dateConv="clr-namespace:Xceed.Wpf.Toolkit.Converters" xmlns:sys="clr-namespace:System;assembly=mscorlib"> @@ -47,7 +48,7 @@ + + ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" + CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CornerRadius, Converter={conv:CornerRadiusReplacementConverter Auto, 0, 0, Auto}}"> + + + @@ -72,7 +73,7 @@ + + ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" + CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CornerRadius, Converter={conv:CornerRadiusReplacementConverter Auto, 0, 0, Auto}}"> + + + x.Value ).ToArray() ); var time = string.Join( cultureInfo.DateTimeFormat.TimeSeparator, timeParts ); + while( millisecondsPart.Length < 3 ) + { + millisecondsPart = "0" + millisecondsPart; + } time += "." + millisecondsPart; return String.Format( "{0} {1} {2}", date, time, designator ); diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml index 2ff6b4e6..91c4446a 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml @@ -18,120 +18,148 @@ - - - + + + - - - + + + - + - + BorderThickness="0" + Background="Transparent" + CaretBrush="{Binding CaretBrush, RelativeSource={RelativeSource TemplatedParent}}" + ContextMenu="{TemplateBinding ContextMenu}" + FontFamily="{TemplateBinding FontFamily}" + FontSize="{TemplateBinding FontSize}" + FontStretch="{TemplateBinding FontStretch}" + FontStyle="{TemplateBinding FontStyle}" + FontWeight="{TemplateBinding FontWeight}" + Foreground="{TemplateBinding Foreground}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}" + IsTabStop="True" + AutoSelectBehavior="OnFocus" + MinWidth="20" + AcceptsReturn="False" + Padding="{TemplateBinding Padding}" + TextAlignment="{TemplateBinding TextAlignment}" + TextWrapping="NoWrap" + TabIndex="{TemplateBinding TabIndex}" + Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" + Watermark="{TemplateBinding Watermark}" + WatermarkTemplate="{TemplateBinding WatermarkTemplate}" /> + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/Generic.xaml index 69204262..c6c9776d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/Generic.xaml @@ -17,47 +17,59 @@ - - - - - - - + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/HighContrast.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/HighContrast.xaml index 69204262..c6c9776d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/HighContrast.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Themes/HighContrast.xaml @@ -17,47 +17,59 @@ - - - - - - - + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml index 97b65651..e75add8d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml @@ -20,6 +20,7 @@ xmlns:local="clr-namespace:Xceed.Wpf.Toolkit" xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes" xmlns:prim="clr-namespace:Xceed.Wpf.Toolkit.Primitives" + xmlns:core="clr-namespace:Xceed.Wpf.Toolkit.Core" xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"> @@ -54,6 +55,8 @@ Value="Right" /> + @@ -73,8 +76,8 @@ SpinnerUpContentTemplate="{Binding ButtonSpinnerUpContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource IncreaseGlyphNormalKey}}" SpinnerDownContentTemplate="{Binding ButtonSpinnerDownContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphNormalKey}}" SpinnerUpDisabledContentTemplate="{Binding ButtonSpinnerUpDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource IncreaseGlyphDisabledKey}}" - SpinnerDownDisabledContentTemplate="{Binding ButtonSpinnerDownDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphDisabledKey}}"> - + SpinnerDownDisabledContentTemplate="{Binding ButtonSpinnerDownDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphDisabledKey}}" + CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CornerRadius}"> @@ -54,6 +55,8 @@ Value="Right" /> + @@ -73,11 +76,12 @@ SpinnerUpContentTemplate="{Binding ButtonSpinnerUpContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource IncreaseGlyphNormalKey}}" SpinnerDownContentTemplate="{Binding ButtonSpinnerDownContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphNormalKey}}" SpinnerUpDisabledContentTemplate="{Binding ButtonSpinnerUpDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource IncreaseGlyphDisabledKey}}" - SpinnerDownDisabledContentTemplate="{Binding ButtonSpinnerDownDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphDisabledKey}}"> + SpinnerDownDisabledContentTemplate="{Binding ButtonSpinnerDownDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphDisabledKey}}" + CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CornerRadius}"> ", OnMaskPropertyChanged ) ); - public string Mask - { - get - { - return ( string )GetValue( MaskProperty ); - } - set - { - SetValue( MaskProperty, value ); - } - } - - private static void OnMaskPropertyChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) - { - MaskedTextBox maskedTextBox = o as MaskedTextBox; - if( maskedTextBox != null ) - maskedTextBox.OnMaskChanged( ( string )e.OldValue, ( string )e.NewValue ); - } - - protected virtual void OnMaskChanged( string oldValue, string newValue ) - { - UpdateMaskProvider( newValue ); - UpdateText( 0 ); - } - - #endregion //Mask - - #region PromptChar - - public static readonly DependencyProperty PromptCharProperty = DependencyProperty.Register( "PromptChar", typeof( char ), typeof( MaskedTextBox ), new UIPropertyMetadata( '_', OnPromptCharChanged ) ); - public char PromptChar - { - get - { - return ( char )GetValue( PromptCharProperty ); - } - set - { - SetValue( PromptCharProperty, value ); - } - } - - private static void OnPromptCharChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) - { - MaskedTextBox maskedTextBox = o as MaskedTextBox; - if( maskedTextBox != null ) - maskedTextBox.OnPromptCharChanged( ( char )e.OldValue, ( char )e.NewValue ); - } - - protected virtual void OnPromptCharChanged( char oldValue, char newValue ) - { - UpdateMaskProvider( Mask ); - } - - #endregion //PromptChar - - #region SelectAllOnGotFocus - - public static readonly DependencyProperty SelectAllOnGotFocusProperty = DependencyProperty.Register( "SelectAllOnGotFocus", typeof( bool ), typeof( MaskedTextBox ), new PropertyMetadata( false ) ); - public bool SelectAllOnGotFocus - { - get - { - return ( bool )GetValue( SelectAllOnGotFocusProperty ); - } - set - { - SetValue( SelectAllOnGotFocusProperty, value ); - } - } - - #endregion //SelectAllOnGotFocus - - #region Text - - private static void OnTextChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) - { - MaskedTextBox inputBase = o as MaskedTextBox; - if( inputBase != null ) - inputBase.OnTextChanged( ( string )e.OldValue, ( string )e.NewValue ); - } - - protected virtual void OnTextChanged( string oldValue, string newValue ) - { - if( _isInitialized ) - SyncTextAndValueProperties( MaskedTextBox.TextProperty, newValue ); - } - - #endregion //Text - - #region Value - - public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( "Value", typeof( object ), typeof( MaskedTextBox ), new FrameworkPropertyMetadata( null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnValueChanged ) ); - public object Value - { - get - { - return ( object )GetValue( ValueProperty ); - } - set - { - SetValue( ValueProperty, value ); - } - } - - private static void OnValueChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) - { - MaskedTextBox maskedTextBox = o as MaskedTextBox; - if( maskedTextBox != null ) - maskedTextBox.OnValueChanged( ( object )e.OldValue, ( object )e.NewValue ); - } - - protected virtual void OnValueChanged( object oldValue, object newValue ) - { - if( _isInitialized ) - SyncTextAndValueProperties( MaskedTextBox.ValueProperty, newValue ); - - RoutedPropertyChangedEventArgs args = new RoutedPropertyChangedEventArgs( oldValue, newValue ); - args.RoutedEvent = MaskedTextBox.ValueChangedEvent; - RaiseEvent( args ); - } - - #endregion //Value - - #region ValueType - - public static readonly DependencyProperty ValueTypeProperty = DependencyProperty.Register( "ValueType", typeof( Type ), typeof( MaskedTextBox ), new UIPropertyMetadata( typeof( String ), OnValueTypeChanged ) ); - public Type ValueType - { - get - { - return ( Type )GetValue( ValueTypeProperty ); - } - set - { - SetValue( ValueTypeProperty, value ); - } - } - - private static void OnValueTypeChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) - { - MaskedTextBox maskedTextBox = o as MaskedTextBox; - if( maskedTextBox != null ) - maskedTextBox.OnValueTypeChanged( ( Type )e.OldValue, ( Type )e.NewValue ); - } - - protected virtual void OnValueTypeChanged( Type oldValue, Type newValue ) - { - if( _isInitialized ) - SyncTextAndValueProperties( MaskedTextBox.TextProperty, Text ); - } - - #endregion //ValueType - - #endregion //Properties - - #region Constructors - - static MaskedTextBox() - { - TextProperty.OverrideMetadata( typeof( MaskedTextBox ), new FrameworkPropertyMetadata( OnTextChanged ) ); - } - - public MaskedTextBox() - { - CommandBindings.Add( new CommandBinding( ApplicationCommands.Paste, Paste ) ); //handle paste - CommandBindings.Add( new CommandBinding( ApplicationCommands.Cut, null, CanCut ) ); //surpress cut - } - - #endregion //Constructors - - #region Base Class Overrides - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - UpdateMaskProvider( Mask ); - UpdateText( 0 ); - } - - protected override void OnInitialized( EventArgs e ) - { - base.OnInitialized( e ); - - if( !_isInitialized ) - { - _isInitialized = true; - SyncTextAndValueProperties( ValueProperty, Value ); - } - } - - protected override void OnGotKeyboardFocus( KeyboardFocusChangedEventArgs e ) - { - if( SelectAllOnGotFocus ) - { - SelectAll(); - } - - base.OnGotKeyboardFocus( e ); - } - - protected override void OnPreviewKeyDown( KeyEventArgs e ) - { - if( !e.Handled ) - { - HandlePreviewKeyDown( e ); - } - - base.OnPreviewKeyDown( e ); - } - - protected override void OnPreviewTextInput( TextCompositionEventArgs e ) - { - if( !e.Handled ) - { - HandlePreviewTextInput( e ); - } - - base.OnPreviewTextInput( e ); - } - - #endregion //Base Class Overrides - - #region Events - - public static readonly RoutedEvent ValueChangedEvent = EventManager.RegisterRoutedEvent( "ValueChanged", RoutingStrategy.Bubble, typeof( RoutedPropertyChangedEventHandler ), typeof( MaskedTextBox ) ); - public event RoutedPropertyChangedEventHandler ValueChanged - { - add - { - AddHandler( ValueChangedEvent, value ); - } - remove - { - RemoveHandler( ValueChangedEvent, value ); - } - } - - #endregion //Events - - #region Methods - - #region Private - - private void UpdateText() - { - UpdateText( SelectionStart ); - } - - private void UpdateText( int position ) - { - MaskedTextProvider provider = MaskProvider; - if( provider == null ) - throw new InvalidOperationException(); - - Text = provider.ToDisplayString(); - SelectionLength = 0; - SelectionStart = position; - } - - private int GetNextCharacterPosition( int startPosition ) - { - int position = MaskProvider.FindEditPositionFrom( startPosition, true ); - return position == -1 ? startPosition : position; - } - - private void UpdateMaskProvider( string mask ) - { - //do not create a mask provider if the Mask is empty, which can occur if the IncludePrompt and IncludeLiterals properties - //are set prior to the Mask. - if( String.IsNullOrEmpty( mask ) ) - return; - - MaskProvider = new MaskedTextProvider( mask ) - { - IncludePrompt = this.IncludePrompt, - IncludeLiterals = this.IncludeLiterals, - PromptChar = this.PromptChar, - ResetOnSpace = false //should make this a property - }; - } - - private object ConvertTextToValue( string text ) - { - object convertedValue = null; - - Type dataType = ValueType; - - string valueToConvert = MaskProvider.ToString().Trim(); - - try - { - if( valueToConvert.GetType() == dataType || dataType.IsInstanceOfType( valueToConvert ) ) - { - convertedValue = valueToConvert; - } -#if !VS2008 - else if( String.IsNullOrWhiteSpace( valueToConvert ) ) - { - convertedValue = Activator.CreateInstance( dataType ); - } -#else - else if ( String.IsNullOrEmpty( valueToConvert ) ) - { - convertedValue = Activator.CreateInstance( dataType ); - } -#endif - else if( null == convertedValue && valueToConvert is IConvertible ) - { - convertedValue = Convert.ChangeType( valueToConvert, dataType ); - } - } - catch - { - //if an excpetion occurs revert back to original value - _convertExceptionOccurred = true; - return Value; - } - - return convertedValue; - } - - private string ConvertValueToText( object value ) - { - if( value == null ) - value = string.Empty; - - if( _convertExceptionOccurred ) - { - value = Value; - _convertExceptionOccurred = false; - } - - //I have only seen this occur while in Blend, but we need it here so the Blend designer doesn't crash. - if( MaskProvider == null ) - return value.ToString(); - - MaskProvider.Set( value.ToString() ); - return MaskProvider.ToDisplayString(); - } - - private void SyncTextAndValueProperties( DependencyProperty p, object newValue ) - { - //prevents recursive syncing properties - if( _isSyncingTextAndValueProperties ) - return; - - _isSyncingTextAndValueProperties = true; - - //this only occures when the user typed in the value - if( MaskedTextBox.TextProperty == p ) - { - if( newValue != null ) - SetValue( MaskedTextBox.ValueProperty, ConvertTextToValue( newValue.ToString() ) ); - } - - SetValue( MaskedTextBox.TextProperty, ConvertValueToText( newValue ) ); - - _isSyncingTextAndValueProperties = false; - } - - private void HandlePreviewTextInput( TextCompositionEventArgs e ) - { - if( !IsReadOnly ) - { - this.InsertText( e.Text ); - } - - e.Handled = true; - } - - private void HandlePreviewKeyDown( KeyEventArgs e ) - { - if( e.Key == Key.Delete ) - { - e.Handled = IsReadOnly - || HandleKeyDownDelete(); - } - else if( e.Key == Key.Back ) - { - e.Handled = IsReadOnly - || HandleKeyDownBack(); - } - else if( e.Key == Key.Space ) - { - if( !IsReadOnly ) - { - InsertText( " " ); - } - - e.Handled = true; - } - else if( e.Key == Key.Return || e.Key == Key.Enter ) - { - if( !IsReadOnly && AcceptsReturn ) - { - this.InsertText( "\r" ); - } - - // We don't want the OnPreviewTextInput to be triggered for the Return/Enter key - // when it is not accepted. - e.Handled = true; - } - else if( e.Key == Key.Escape ) - { - // We don't want the OnPreviewTextInput to be triggered at all for the Escape key. - e.Handled = true; - } - else if( e.Key == Key.Tab ) - { - if( AcceptsTab ) - { - if( !IsReadOnly ) - { - this.InsertText( "\t" ); - } - - e.Handled = true; - } - } - } - - private bool HandleKeyDownDelete() - { - ModifierKeys modifiers = Keyboard.Modifiers; - bool handled = true; - - if( modifiers == ModifierKeys.None ) - { - if( !RemoveSelectedText() ) - { - int position = SelectionStart; - - if( position < Text.Length ) - { - RemoveText( position, 1 ); - UpdateText( position ); - } - } - else - { - UpdateText(); - } - } - else if( modifiers == ModifierKeys.Control ) - { - if( !RemoveSelectedText() ) - { - int position = SelectionStart; - - RemoveTextToEnd( position ); - UpdateText( position ); - } - else - { - UpdateText(); - } - } - else if( modifiers == ModifierKeys.Shift ) - { - if( RemoveSelectedText() ) - { - UpdateText(); - } - else - { - handled = false; - } - } - else - { - handled = false; - } - - return handled; - } - - private bool HandleKeyDownBack() - { - ModifierKeys modifiers = Keyboard.Modifiers; - bool handled = true; - - if( modifiers == ModifierKeys.None || modifiers == ModifierKeys.Shift ) - { - if( !RemoveSelectedText() ) - { - int position = SelectionStart; - - if( position > 0 ) - { - int newPosition = position - 1; - - RemoveText( newPosition, 1 ); - UpdateText( newPosition ); - } - } - else - { - UpdateText(); - } - } - else if( modifiers == ModifierKeys.Control ) - { - if( !RemoveSelectedText() ) - { - RemoveTextFromStart( SelectionStart ); - UpdateText( 0 ); - } - else - { - UpdateText(); - } - } - else - { - handled = false; - } - - return handled; - } - - private void InsertText( string text ) - { - int position = SelectionStart; - MaskedTextProvider provider = MaskProvider; - - bool textRemoved = this.RemoveSelectedText(); - - position = GetNextCharacterPosition( position ); - - if( !textRemoved && Keyboard.IsKeyToggled( Key.Insert ) ) - { - if( provider.Replace( text, position ) ) - { - position += text.Length; - } - } - else - { - if( provider.InsertAt( text, position ) ) - { - position += text.Length; - } - } - - position = GetNextCharacterPosition( position ); - - this.UpdateText( position ); - } - - private void RemoveTextFromStart( int endPosition ) - { - RemoveText( 0, endPosition ); - } - - private void RemoveTextToEnd( int startPosition ) - { - RemoveText( startPosition, Text.Length - startPosition ); - } - - private void RemoveText( int position, int length ) - { - if( length == 0 ) - return; - - MaskProvider.RemoveAt( position, position + length - 1 ); - } - - private bool RemoveSelectedText() - { - int length = SelectionLength; - - if( length == 0 ) - return false; - - int position = SelectionStart; - - return MaskProvider.RemoveAt( position, position + length - 1 ); - } - - #endregion //Private - - #endregion //Methods - - #region Commands - - private void Paste( object sender, RoutedEventArgs e ) - { - if( IsReadOnly ) - return; - - object data = Clipboard.GetData( DataFormats.Text ); - if( data != null ) - { - string text = data.ToString().Trim(); - if( text.Length > 0 ) - { - int position = SelectionStart; - - MaskProvider.Set( text ); - - UpdateText( position ); - } - } - } - - private void CanCut( object sender, CanExecuteRoutedEventArgs e ) - { - e.CanExecute = false; - e.Handled = true; - } - - #endregion //Commands - } -} diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/InputBase.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/InputBase.cs index 76342a96..c65fe8d3 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/InputBase.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/InputBase.cs @@ -27,6 +27,35 @@ namespace Xceed.Wpf.Toolkit.Primitives { #region Properties + #region CornerRadius + + public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register( nameof(CornerRadius), typeof( CornerRadius ), typeof( InputBase ), new UIPropertyMetadata( new CornerRadius(), OnCornerRadiusPropertyChanged ) ); + public CornerRadius CornerRadius + { + get + { + return ( CornerRadius )GetValue( CornerRadiusProperty ); + } + set + { + SetValue( CornerRadiusProperty, value ); + } + } + + private static void OnCornerRadiusPropertyChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + InputBase inputBase = o as InputBase; + if( inputBase != null ) + inputBase.OnCornerRadiusChanged( ( CornerRadius )e.OldValue, ( CornerRadius )e.NewValue ); + } + + protected virtual void OnCornerRadiusChanged( CornerRadius oldValue, CornerRadius newValue ) + { + } + + #endregion //CornerRadius + + #region AllowTextInput public static readonly DependencyProperty AllowTextInputProperty = DependencyProperty.Register( "AllowTextInput", typeof( bool ), typeof( InputBase ), new UIPropertyMetadata( true, OnAllowTextInputChanged ) ); diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/SelectAllSelector.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/SelectAllSelector.cs index 2c72e871..2853a756 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/SelectAllSelector.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/SelectAllSelector.cs @@ -15,10 +15,13 @@ ***********************************************************************************/ +using System.Collections; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Windows; +using System.Windows.Data; namespace Xceed.Wpf.Toolkit.Primitives { @@ -126,6 +129,21 @@ namespace Xceed.Wpf.Toolkit.Primitives #endregion //IsSelectAllActive + + + + + + + + + + + + + + + #region SelectAllContent public static readonly DependencyProperty SelectAllContentProperty = DependencyProperty.Register( "SelectAllContent", typeof( object ), typeof( SelectAllSelector ), new UIPropertyMetadata( "Select All" ) ); @@ -237,6 +255,22 @@ namespace Xceed.Wpf.Toolkit.Primitives } } + + + + + + + + + + #endregion + + #region Protected Methods + protected override void OnItemsSourceChanged( IEnumerable oldValue, IEnumerable newValue ) + { + base.OnItemsSourceChanged( oldValue, newValue ); + } #endregion } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Selector.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Selector.cs index f5df285a..2ba61384 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Selector.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Selector.cs @@ -911,6 +911,7 @@ namespace Xceed.Wpf.Toolkit.Primitives private void RemoveUnavailableSelectedItems() { + _ignoreSelectedItemsCollectionChanged++; HashSet hash = new HashSet( ItemsCollection.Cast() ); diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml index 66b9ba60..b2dbd144 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml @@ -82,8 +82,8 @@ Grid.Column="1" VerticalAlignment="Center" Source="{TemplateBinding CaptionIcon}" - MaxWidth="15" - MaxHeight="15" + MaxWidth="17" + MaxHeight="17" Margin="5,2,0,2"> e ) { Color? selectedColor = ( Color? )e.NewValue; - ApplyPropertyValueToSelectedText( TextElement.ForegroundProperty, selectedColor.HasValue ? new SolidColorBrush( selectedColor.Value ) : null ); - _waitingForMouseOver = true; + this.ApplyPropertyValueToSelectedText( TextElement.ForegroundProperty, selectedColor.HasValue ? new SolidColorBrush( selectedColor.Value ) : null ); + m_waitingForMouseOver = true; } private void FontBackgroundColor_SelectedColorChanged( object sender, RoutedPropertyChangedEventArgs e ) { Color? selectedColor = ( Color? )e.NewValue; - ApplyPropertyValueToSelectedText( TextElement.BackgroundProperty, selectedColor.HasValue ? new SolidColorBrush( selectedColor.Value ) : null ); - _waitingForMouseOver = true; + this.ApplyPropertyValueToSelectedText( TextElement.BackgroundProperty, selectedColor.HasValue ? new SolidColorBrush( selectedColor.Value ) : null ); + m_waitingForMouseOver = true; } private void Bullets_Clicked( object sender, RoutedEventArgs e ) { - if( BothSelectionListsAreChecked() && ( _btnNumbers != null ) ) + if( this.BothSelectionListsAreChecked() && ( m_btnNumbers != null ) ) { - _btnNumbers.IsChecked = false; + m_btnNumbers.IsChecked = false; } } private void Numbers_Clicked( object sender, RoutedEventArgs e ) { - if( BothSelectionListsAreChecked() && ( _btnBullets != null ) ) + if( this.BothSelectionListsAreChecked() && ( m_btnBullets != null ) ) { - _btnBullets.IsChecked = false; + m_btnBullets.IsChecked = false; } } private void DragWidget_DragDelta( object sender, DragDeltaEventArgs e ) { - ProcessMove( e ); + this.ProcessMove( e ); } protected override void OnMouseEnter( System.Windows.Input.MouseEventArgs e ) { base.OnMouseEnter( e ); - _waitingForMouseOver = false; + m_waitingForMouseOver = false; } - #endregion //Event Hanlders + #endregion //Event Handlers #region Methods @@ -157,93 +170,92 @@ namespace Xceed.Wpf.Toolkit { base.OnApplyTemplate(); - if( _dragWidget != null ) + if( m_dragWidget != null ) { - _dragWidget.DragDelta -= new DragDeltaEventHandler( DragWidget_DragDelta ); + m_dragWidget.DragDelta -= new DragDeltaEventHandler( this.DragWidget_DragDelta ); } - if( _cmbFontFamilies != null ) + if( m_cmbFontFamilies != null ) { - _cmbFontFamilies.SelectionChanged -= new SelectionChangedEventHandler( FontFamily_SelectionChanged ); + m_cmbFontFamilies.SelectionChanged -= new SelectionChangedEventHandler( this.FontFamily_SelectionChanged ); } - if( _cmbFontSizes != null ) + if( m_cmbFontSizes != null ) { - _cmbFontSizes.SelectionChanged -= new SelectionChangedEventHandler( FontSize_SelectionChanged ); + m_cmbFontSizes.SelectionChanged -= new SelectionChangedEventHandler( this.FontSize_SelectionChanged ); } - if( _btnBullets != null ) + if( m_btnBullets != null ) { - _btnBullets.Click -= new RoutedEventHandler( Bullets_Clicked ); + m_btnBullets.Click -= new RoutedEventHandler( this.Bullets_Clicked ); } - if( _btnNumbers != null ) + if( m_btnNumbers != null ) { - _btnNumbers.Click -= new RoutedEventHandler( Numbers_Clicked ); + m_btnNumbers.Click -= new RoutedEventHandler( this.Numbers_Clicked ); } - if( _cmbFontBackgroundColor != null ) + if( m_cmbFontBackgroundColor != null ) { - _cmbFontBackgroundColor.SelectedColorChanged -= new RoutedPropertyChangedEventHandler( FontBackgroundColor_SelectedColorChanged ); + m_cmbFontBackgroundColor.SelectedColorChanged -= new RoutedPropertyChangedEventHandler( this.FontBackgroundColor_SelectedColorChanged ); } - if( _cmbFontColor != null ) + if( m_cmbFontColor != null ) { - _cmbFontColor.SelectedColorChanged -= new RoutedPropertyChangedEventHandler( FontColor_SelectedColorChanged ); + m_cmbFontColor.SelectedColorChanged -= new RoutedPropertyChangedEventHandler( this.FontColor_SelectedColorChanged ); } - this.GetTemplateComponent( ref _cmbFontFamilies, "_cmbFontFamilies" ); - this.GetTemplateComponent( ref _cmbFontSizes, "_cmbFontSizes" ); - this.GetTemplateComponent( ref _cmbFontBackgroundColor, "_cmbFontBackgroundColor" ); - this.GetTemplateComponent( ref _cmbFontColor, "_cmbFontColor" ); - this.GetTemplateComponent( ref _btnNumbers, "_btnNumbers" ); - this.GetTemplateComponent( ref _btnBullets, "_btnBullets" ); - this.GetTemplateComponent( ref _btnBold, "_btnBold" ); - this.GetTemplateComponent( ref _btnItalic, "_btnItalic" ); - this.GetTemplateComponent( ref _btnUnderline, "_btnUnderline" ); - this.GetTemplateComponent( ref _btnAlignLeft, "_btnAlignLeft" ); - this.GetTemplateComponent( ref _btnAlignCenter, "_btnAlignCenter" ); - this.GetTemplateComponent( ref _btnAlignRight, "_btnAlignRight" ); - this.GetTemplateComponent( ref _dragWidget, "_dragWidget" ); - - if( _dragWidget != null ) + this.GetTemplateComponent( ref m_cmbFontFamilies, "_cmbFontFamilies" ); + this.GetTemplateComponent( ref m_cmbFontSizes, "_cmbFontSizes" ); + this.GetTemplateComponent( ref m_cmbFontBackgroundColor, "_cmbFontBackgroundColor" ); + this.GetTemplateComponent( ref m_cmbFontColor, "_cmbFontColor" ); + this.GetTemplateComponent( ref m_btnNumbers, "_btnNumbers" ); + this.GetTemplateComponent( ref m_btnBullets, "_btnBullets" ); + this.GetTemplateComponent( ref m_btnBold, "_btnBold" ); + this.GetTemplateComponent( ref m_btnItalic, "_btnItalic" ); + this.GetTemplateComponent( ref m_btnUnderline, "_btnUnderline" ); + this.GetTemplateComponent( ref m_btnAlignLeft, "_btnAlignLeft" ); + this.GetTemplateComponent( ref m_btnAlignCenter, "_btnAlignCenter" ); + this.GetTemplateComponent( ref m_btnAlignRight, "_btnAlignRight" ); + this.GetTemplateComponent( ref m_dragWidget, "_dragWidget" ); + + if( m_dragWidget != null ) { - _dragWidget.DragDelta += new DragDeltaEventHandler( DragWidget_DragDelta ); + m_dragWidget.DragDelta += new DragDeltaEventHandler( DragWidget_DragDelta ); } - if( _cmbFontFamilies != null ) + if( m_cmbFontFamilies != null ) { - _cmbFontFamilies.ItemsSource = FontUtilities.Families.OrderBy( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) ).Select( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) ); - _cmbFontFamilies.SelectionChanged += new SelectionChangedEventHandler( FontFamily_SelectionChanged ); + m_cmbFontFamilies.ItemsSource = FontUtilities.Families.OrderBy( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) ).Select( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) ); + m_cmbFontFamilies.SelectionChanged += new SelectionChangedEventHandler( this.FontFamily_SelectionChanged ); } - if( _cmbFontSizes != null ) + if( m_cmbFontSizes != null ) { - _cmbFontSizes.ItemsSource = FontSizes; - _cmbFontSizes.SelectionChanged += new SelectionChangedEventHandler( FontSize_SelectionChanged ); + m_cmbFontSizes.ItemsSource = FontSizes; + m_cmbFontSizes.SelectionChanged += new SelectionChangedEventHandler( this.FontSize_SelectionChanged ); } - if( _btnBullets != null ) + if( m_btnBullets != null ) { - _btnBullets.Click += new RoutedEventHandler( Bullets_Clicked ); + m_btnBullets.Click += new RoutedEventHandler( this.Bullets_Clicked ); } - if( _btnNumbers != null ) + if( m_btnNumbers != null ) { - _btnNumbers.Click += new RoutedEventHandler( Numbers_Clicked ); + m_btnNumbers.Click += new RoutedEventHandler( this.Numbers_Clicked ); } - if( _cmbFontBackgroundColor != null ) + if( m_cmbFontBackgroundColor != null ) { - _cmbFontBackgroundColor.SelectedColorChanged += new RoutedPropertyChangedEventHandler( FontBackgroundColor_SelectedColorChanged ); + m_cmbFontBackgroundColor.SelectedColorChanged += new RoutedPropertyChangedEventHandler( this.FontBackgroundColor_SelectedColorChanged ); } - if( _cmbFontColor != null ) + if( m_cmbFontColor != null ) { - _cmbFontColor.SelectedColorChanged += new RoutedPropertyChangedEventHandler( FontColor_SelectedColorChanged ); + m_cmbFontColor.SelectedColorChanged += new RoutedPropertyChangedEventHandler( FontColor_SelectedColorChanged ); } - // Update the ComboBoxes when changing themes. this.Update(); } @@ -256,21 +268,21 @@ namespace Xceed.Wpf.Toolkit private void UpdateToggleButtonState() { - UpdateItemCheckedState( _btnBold, TextElement.FontWeightProperty, FontWeights.Bold ); - UpdateItemCheckedState( _btnItalic, TextElement.FontStyleProperty, FontStyles.Italic ); - UpdateItemCheckedState( _btnUnderline, Inline.TextDecorationsProperty, TextDecorations.Underline ); + this.UpdateItemCheckedState( m_btnBold, TextElement.FontWeightProperty, FontWeights.Bold ); + this.UpdateItemCheckedState( m_btnItalic, TextElement.FontStyleProperty, FontStyles.Italic ); + this.UpdateItemCheckedState( m_btnUnderline, Inline.TextDecorationsProperty, TextDecorations.Underline ); - UpdateItemCheckedState( _btnAlignLeft, Paragraph.TextAlignmentProperty, TextAlignment.Left ); - UpdateItemCheckedState( _btnAlignCenter, Paragraph.TextAlignmentProperty, TextAlignment.Center ); - UpdateItemCheckedState( _btnAlignRight, Paragraph.TextAlignmentProperty, TextAlignment.Right ); + this.UpdateItemCheckedState( m_btnAlignLeft, Paragraph.TextAlignmentProperty, TextAlignment.Left ); + this.UpdateItemCheckedState( m_btnAlignCenter, Paragraph.TextAlignmentProperty, TextAlignment.Center ); + this.UpdateItemCheckedState( m_btnAlignRight, Paragraph.TextAlignmentProperty, TextAlignment.Right ); } void UpdateItemCheckedState( ToggleButton button, DependencyProperty formattingProperty, object expectedValue ) { object currentValue = DependencyProperty.UnsetValue; - if( ( Target != null ) && ( Target.Selection != null ) ) + if( ( this.Target != null ) && ( this.Target.Selection != null ) ) { - currentValue = Target.Selection.GetPropertyValue( formattingProperty ); + currentValue = this.Target.Selection.GetPropertyValue( formattingProperty ); } if( currentValue == DependencyProperty.UnsetValue ) @@ -287,44 +299,44 @@ namespace Xceed.Wpf.Toolkit private void UpdateSelectedFontFamily() { object value = DependencyProperty.UnsetValue; - if( ( Target != null ) && ( Target.Selection != null ) ) + if( ( this.Target != null ) && ( this.Target.Selection != null ) ) { - value = Target.Selection.GetPropertyValue( TextElement.FontFamilyProperty ); + value = this.Target.Selection.GetPropertyValue( TextElement.FontFamilyProperty ); } if( value == DependencyProperty.UnsetValue ) return; FontFamily currentFontFamily = ( FontFamily )value; - if( ( currentFontFamily != null ) && ( _cmbFontFamilies != null ) ) + if( ( currentFontFamily != null ) && ( m_cmbFontFamilies != null ) ) { - _cmbFontFamilies.SelectedItem = FontUtilities.GetFontFamilyName( currentFontFamily ); + m_cmbFontFamilies.SelectedItem = FontUtilities.GetFontFamilyName( currentFontFamily ); } } private void UpdateSelectedFontSize() { object value = DependencyProperty.UnsetValue; - if( ( Target != null ) && ( Target.Selection != null ) ) + if( ( this.Target != null ) && ( this.Target.Selection != null ) ) { - value = Target.Selection.GetPropertyValue( TextElement.FontSizeProperty ); + value = this.Target.Selection.GetPropertyValue( TextElement.FontSizeProperty ); } if( value == DependencyProperty.UnsetValue ) return; - if( _cmbFontSizes != null ) + if( m_cmbFontSizes != null ) { - _cmbFontSizes.SelectedValue = value; + m_cmbFontSizes.SelectedValue = value; } } private void UpdateFontColor() { object value = DependencyProperty.UnsetValue; - if( ( Target != null ) && ( Target.Selection != null ) ) + if( ( this.Target != null ) && ( this.Target.Selection != null ) ) { - value = Target.Selection.GetPropertyValue( TextElement.ForegroundProperty ); + value = this.Target.Selection.GetPropertyValue( TextElement.ForegroundProperty ); } if( value == DependencyProperty.UnsetValue ) @@ -333,18 +345,18 @@ namespace Xceed.Wpf.Toolkit Color? currentColor = ( ( value == null ) ? null : ( Color? )( ( SolidColorBrush )value ).Color ); - if( _cmbFontColor != null ) + if( m_cmbFontColor != null ) { - _cmbFontColor.SelectedColor = currentColor; + m_cmbFontColor.SelectedColor = currentColor; } } private void UpdateFontBackgroundColor() { object value = DependencyProperty.UnsetValue; - if( ( Target != null ) && ( Target.Selection != null ) ) + if( ( this.Target != null ) && ( this.Target.Selection != null ) ) { - value = Target.Selection.GetPropertyValue( TextElement.BackgroundProperty ); + value = this.Target.Selection.GetPropertyValue( TextElement.BackgroundProperty ); } if( value == DependencyProperty.UnsetValue ) @@ -353,67 +365,67 @@ namespace Xceed.Wpf.Toolkit Color? currentColor = ( ( value == null ) ? null : ( Color? )( ( SolidColorBrush )value ).Color ); - if( _cmbFontBackgroundColor != null ) + if( m_cmbFontBackgroundColor != null ) { - _cmbFontBackgroundColor.SelectedColor = currentColor; + m_cmbFontBackgroundColor.SelectedColor = currentColor; } } private void UpdateSelectionListType() { - if( ( _btnNumbers == null ) || ( _btnBullets == null ) ) + if( ( m_btnNumbers == null ) || ( m_btnBullets == null ) ) return; //uncheck both - _btnBullets.IsChecked = false; - _btnNumbers.IsChecked = false; + m_btnBullets.IsChecked = false; + m_btnNumbers.IsChecked = false; - Paragraph startParagraph = ( ( Target != null ) && ( Target.Selection != null ) ) - ? Target.Selection.Start.Paragraph + Paragraph startParagraph = ( ( this.Target != null ) && ( this.Target.Selection != null ) ) + ? this.Target.Selection.Start.Paragraph : null; - Paragraph endParagraph = ( ( Target != null ) && ( Target.Selection != null ) ) - ? Target.Selection.End.Paragraph + Paragraph endParagraph = ( ( this.Target != null ) && ( this.Target.Selection != null ) ) + ? this.Target.Selection.End.Paragraph : null; if( startParagraph != null && endParagraph != null && ( startParagraph.Parent is ListItem ) && ( endParagraph.Parent is ListItem ) && object.ReferenceEquals( ( ( ListItem )startParagraph.Parent ).List, ( ( ListItem )endParagraph.Parent ).List ) ) { TextMarkerStyle markerStyle = ( ( ListItem )startParagraph.Parent ).List.MarkerStyle; - if( markerStyle == TextMarkerStyle.Disc ) //bullets + if( markerStyle == TextMarkerStyle.Disc ) { - _btnBullets.IsChecked = true; + m_btnBullets.IsChecked = true; } - else if( markerStyle == TextMarkerStyle.Decimal ) //numbers + else if( markerStyle == TextMarkerStyle.Decimal ) { - _btnNumbers.IsChecked = true; + m_btnNumbers.IsChecked = true; } } } private bool BothSelectionListsAreChecked() { - return ( ( _btnBullets != null ) && ( _btnBullets.IsChecked == true ) ) - && ( ( _btnNumbers != null ) && ( _btnNumbers.IsChecked == true ) ); + return ( ( m_btnBullets != null ) && ( m_btnBullets.IsChecked == true ) ) + && ( ( m_btnNumbers != null ) && ( m_btnNumbers.IsChecked == true ) ); } void ApplyPropertyValueToSelectedText( DependencyProperty formattingProperty, object value ) { - if( ( Target == null ) || ( Target.Selection == null ) ) + if( ( this.Target == null ) || ( this.Target.Selection == null ) ) return; SolidColorBrush solidColorBrush = value as SolidColorBrush; if( ( solidColorBrush != null ) && solidColorBrush.Color.Equals( Colors.Transparent ) ) { - Target.Selection.ApplyPropertyValue( formattingProperty, null ); + this.Target.Selection.ApplyPropertyValue( formattingProperty, null ); } else { - Target.Selection.ApplyPropertyValue( formattingProperty, value ); + this.Target.Selection.ApplyPropertyValue( formattingProperty, value ); } } private void ProcessMove( DragDeltaEventArgs e ) { - AdornerLayer layer = AdornerLayer.GetAdornerLayer( Target ); - UIElementAdorner adorner = layer.GetAdorners( Target ).OfType>().First(); + AdornerLayer layer = AdornerLayer.GetAdornerLayer( this.Target ); + UIElementAdorner adorner = layer.GetAdorners( this.Target ).OfType>().First(); adorner.SetOffsets( adorner.OffsetLeft + e.HorizontalChange, adorner.OffsetTop + e.VerticalChange ); } @@ -423,17 +435,11 @@ namespace Xceed.Wpf.Toolkit #region Target - public static readonly DependencyProperty TargetProperty = DependencyProperty.Register( "Target", typeof( global::System.Windows.Controls.RichTextBox ), typeof( RichTextBoxFormatBar ), new PropertyMetadata( null, OnRichTextBoxPropertyChanged ) ); + public static readonly DependencyProperty TargetProperty = DependencyProperty.Register( nameof( Target ), typeof( global::System.Windows.Controls.RichTextBox ), typeof( RichTextBoxFormatBar ), new PropertyMetadata( null, OnRichTextBoxPropertyChanged ) ); public global::System.Windows.Controls.RichTextBox Target { - get - { - return ( global::System.Windows.Controls.RichTextBox )GetValue( TargetProperty ); - } - set - { - SetValue( TargetProperty, value ); - } + get { return ( global::System.Windows.Controls.RichTextBox )GetValue( TargetProperty ); } + set { SetValue( TargetProperty, value ); } } private static void OnRichTextBoxPropertyChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) @@ -447,22 +453,22 @@ namespace Xceed.Wpf.Toolkit { get { - return ( ( ( _cmbFontFamilies != null ) && _cmbFontFamilies.IsDropDownOpen ) - || ( ( _cmbFontSizes != null ) && _cmbFontSizes.IsDropDownOpen ) - || ( ( _cmbFontBackgroundColor != null ) && _cmbFontBackgroundColor.IsOpen ) - || ( ( _cmbFontColor != null ) && _cmbFontColor.IsOpen ) - || _waitingForMouseOver ); + return ( ( ( m_cmbFontFamilies != null ) && m_cmbFontFamilies.IsDropDownOpen ) + || ( ( m_cmbFontSizes != null ) && m_cmbFontSizes.IsDropDownOpen ) + || ( ( m_cmbFontBackgroundColor != null ) && m_cmbFontBackgroundColor.IsOpen ) + || ( ( m_cmbFontColor != null ) && m_cmbFontColor.IsOpen ) + || m_waitingForMouseOver ); } } public void Update() { - UpdateToggleButtonState(); - UpdateSelectedFontFamily(); - UpdateSelectedFontSize(); - UpdateFontColor(); - UpdateFontBackgroundColor(); - UpdateSelectionListType(); + this.UpdateToggleButtonState(); + this.UpdateSelectedFontFamily(); + this.UpdateSelectedFontSize(); + this.UpdateFontColor(); + this.UpdateFontBackgroundColor(); + this.UpdateSelectionListType(); } #endregion diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs index 7f7c9822..a66ef285 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs @@ -29,12 +29,11 @@ namespace Xceed.Wpf.Toolkit { #region Members - private global::System.Windows.Controls.RichTextBox _richTextBox; - private UIElementAdorner _adorner; - private IRichTextBoxFormatBar _toolbar; - private Window _parentWindow; - - private const double _hideAdornerDistance = 150d; + private global::System.Windows.Controls.RichTextBox m_richTextBox; + private UIElementAdorner m_adorner; + private IRichTextBoxFormatBar m_toolbar; + private Window m_parentWindow; + private const double m_hideAdornerDistance = 150d; #endregion //Members @@ -68,11 +67,12 @@ namespace Xceed.Wpf.Toolkit { get { - return _adorner.Visibility == Visibility.Visible; + return m_adorner.Visibility == Visibility.Visible; } } - #endregion //Properties + +#endregion //Properties #region Event Handlers @@ -80,59 +80,66 @@ namespace Xceed.Wpf.Toolkit { if( e.ChangedButton == MouseButton.Left && e.LeftButton == MouseButtonState.Released ) { - if( !_richTextBox.IsReadOnly ) + if( !m_richTextBox.IsReadOnly ) { - TextRange selectedText = new TextRange( _richTextBox.Selection.Start, _richTextBox.Selection.End ); + TextRange selectedText = new TextRange( m_richTextBox.Selection.Start, m_richTextBox.Selection.End ); #if !VS2008 if( selectedText.Text.Length > 0 && !String.IsNullOrWhiteSpace( selectedText.Text ) ) - ShowAdorner(); + { + this.ShowAdorner(); + } #else - if( selectedText.Text.Length > 0 && !String.IsNullOrEmpty( selectedText.Text ) ) - ShowAdorner(); + if (selectedText.Text.Length > 0 && !String.IsNullOrEmpty(selectedText.Text)) + { + this.ShowAdorner(); + } #endif else - HideAdorner(); - + { + { + this.HideAdorner(); + } + } e.Handled = true; } } - else - HideAdorner(); } private void OnPreviewMouseMoveParentWindow( object sender, MouseEventArgs e ) { - Point p = e.GetPosition( _adorner ); + + Point p = e.GetPosition( m_adorner ); double maxDist = 0d; - bool preventDisplayFadeOut = ( ( _adorner.Child != null ) && ( _adorner.Child is IRichTextBoxFormatBar ) ) ? - ( ( IRichTextBoxFormatBar )_adorner.Child ).PreventDisplayFadeOut : - false; + bool preventDisplayFadeOut = ( ( m_adorner.Child != null ) && ( m_adorner.Child is IRichTextBoxFormatBar ) ) + ? ( ( IRichTextBoxFormatBar )m_adorner.Child ).PreventDisplayFadeOut + : false; //Mouse is inside FormatBar: Nothing to do. + if( preventDisplayFadeOut || - ( p.X >= 0 ) && ( p.X <= _adorner.ActualWidth ) && ( p.Y >= 0 ) && ( p.Y <= _adorner.ActualHeight ) ) + ( p.X >= 0 ) && ( p.X <= m_adorner.ActualWidth ) && ( p.Y >= 0 ) && ( p.Y <= m_adorner.ActualHeight ) ) { return; } //Mouse is too much outside FormatBar: Close it. - else if( ( p.X < -_hideAdornerDistance ) || ( p.X > _adorner.ActualWidth + _hideAdornerDistance ) || ( p.Y < -_hideAdornerDistance ) || ( p.Y > _adorner.ActualHeight + _hideAdornerDistance ) ) + else if( ( p.X < -m_hideAdornerDistance ) || ( p.X > m_adorner.ActualWidth + m_hideAdornerDistance ) || ( p.Y < -m_hideAdornerDistance ) || ( p.Y > m_adorner.ActualHeight + m_hideAdornerDistance ) ) { - HideAdorner(); + this.HideAdorner(); } //Mouse is just outside FormatBar: Vary its opacity. else { if( p.X < 0 ) maxDist = -p.X; - else if( p.X > _adorner.ActualWidth ) - maxDist = p.X - _adorner.ActualWidth; + else if( p.X > m_adorner.ActualWidth ) + maxDist = p.X - m_adorner.ActualWidth; if( p.Y < 0 ) maxDist = Math.Max( maxDist, -p.Y ); - else if( p.Y > _adorner.ActualHeight ) - maxDist = Math.Max( maxDist, p.Y - _adorner.ActualHeight ); + else if( p.Y > m_adorner.ActualHeight ) + maxDist = Math.Max( maxDist, p.Y - m_adorner.ActualHeight ); - _adorner.Opacity = 1d - ( Math.Min( maxDist, 100d ) / 100d ); + m_adorner.Opacity = 1d - ( Math.Min( maxDist, 100d ) / 100d ); } } @@ -140,60 +147,102 @@ namespace Xceed.Wpf.Toolkit { //This fixes the bug when applying text transformations the text would lose it's highlight. That was because the RichTextBox was losing focus, //so we just give it focus again and it seems to do the trick of re-highlighting it. - if( !_richTextBox.IsFocused && !_richTextBox.Selection.IsEmpty ) - _richTextBox.Focus(); + if( !m_richTextBox.IsFocused && !m_richTextBox.Selection.IsEmpty ) + m_richTextBox.Focus(); + } + + void RichTextBox_Loaded( object sender, RoutedEventArgs e ) + { + } + + void RichTextBox_GotFocus( object sender, RoutedEventArgs e ) + { } - #endregion //Event Handlers + +#endregion //Event Handlers #region Methods + private bool IsCursorInsideWord() + { + if( m_richTextBox?.Selection?.Start == null ) + return false; + + TextPointer caretPosition = m_richTextBox.Selection.Start; + + string charBefore = caretPosition.GetTextInRun( LogicalDirection.Backward ); + string charAfter = caretPosition.GetTextInRun( LogicalDirection.Forward ); + + bool hasWordCharBefore = !string.IsNullOrEmpty( charBefore ) && + charBefore.Length > 0 && + char.IsLetterOrDigit( charBefore[ charBefore.Length - 1 ] ); + + bool hasWordCharAfter = !string.IsNullOrEmpty( charAfter ) && + charAfter.Length > 0 && + char.IsLetterOrDigit( charAfter[ 0 ] ); + + return hasWordCharBefore || hasWordCharAfter; + } + + private void AttachFormatBarToRichtextBox( global::System.Windows.Controls.RichTextBox richTextBox, IRichTextBoxFormatBar formatBar ) { - _richTextBox = richTextBox; + m_richTextBox = richTextBox; //we cannot use the PreviewMouseLeftButtonUp event because of selection bugs. //we cannot use the MouseLeftButtonUp event because it is handled by the RichTextBox and does not bubble up to here, so we must //add a hander to the MouseUpEvent using the Addhandler syntax, and specify to listen for handled events too. - _richTextBox.AddHandler( Mouse.MouseUpEvent, new MouseButtonEventHandler( RichTextBox_MouseButtonUp ), true ); - _richTextBox.TextChanged += RichTextBox_TextChanged; + m_richTextBox.AddHandler( Mouse.MouseUpEvent, new MouseButtonEventHandler( this.RichTextBox_MouseButtonUp ), true ); + m_richTextBox.TextChanged += this.RichTextBox_TextChanged; + m_richTextBox.Loaded += this.RichTextBox_Loaded; + m_richTextBox.GotFocus += this.RichTextBox_GotFocus; + m_adorner = new UIElementAdorner( m_richTextBox ); - _adorner = new UIElementAdorner( _richTextBox ); + formatBar.Target = m_richTextBox; + m_toolbar = formatBar; - formatBar.Target = _richTextBox; - _toolbar = formatBar; + { + this.HideAdorner(); + } } - void ShowAdorner() + + private void ShowAdorner() { - if( _adorner.Visibility == Visibility.Visible ) + if( m_adorner.Visibility == Visibility.Visible ) { - HideAdorner(); + this.HideAdorner(); } - VerifyAdornerLayer(); + this.VerifyAdornerLayer(); - Control adorningEditor = _toolbar as Control; + Control adorningEditor = m_toolbar as Control; - if( _adorner.Child == null ) - _adorner.Child = adorningEditor; + if( m_adorner.Child == null ) + { + m_adorner.Child = adorningEditor; + } adorningEditor.ApplyTemplate(); - _toolbar.Update(); + m_toolbar.Update(); - _adorner.Visibility = Visibility.Visible; + m_adorner.Visibility = Visibility.Visible; - PositionFormatBar( adorningEditor ); + { + this.MousePositionFormatBar( adorningEditor ); + } - _parentWindow = TreeHelper.FindParent( _adorner ); - if( _parentWindow != null ) + m_parentWindow = TreeHelper.FindParent( m_adorner ); + if( m_parentWindow != null + ) { - Mouse.AddMouseMoveHandler( _parentWindow, OnPreviewMouseMoveParentWindow ); + Mouse.AddMouseMoveHandler( m_parentWindow, this.OnPreviewMouseMoveParentWindow ); } } - private void PositionFormatBar( Control adorningEditor ) + private void MousePositionFormatBar( Control adorningEditor ) { - Point mousePosition = Mouse.GetPosition( _richTextBox ); + Point mousePosition = Mouse.GetPosition( m_richTextBox ); var left = mousePosition.X; var top = mousePosition.Y; @@ -211,42 +260,64 @@ namespace Xceed.Wpf.Toolkit } // Right boundary - if( left + adorningEditor.ActualWidth > _richTextBox.ActualWidth - 10d ) + if( left + adorningEditor.ActualWidth > m_richTextBox.ActualWidth - 10d ) { - left = _richTextBox.ActualWidth - adorningEditor.ActualWidth - 10d; + left = m_richTextBox.ActualWidth - adorningEditor.ActualWidth - 10d; } // Bottom boundary - if( top + adorningEditor.ActualHeight > _richTextBox.ActualHeight - 10d ) + if( top + adorningEditor.ActualHeight > m_richTextBox.ActualHeight - 10d ) { - top = _richTextBox.ActualHeight - adorningEditor.ActualHeight - 10d; + top = m_richTextBox.ActualHeight - adorningEditor.ActualHeight - 10d; } - _adorner.SetOffsets( left, top ); + m_adorner.SetOffsets( left, top ); } - bool VerifyAdornerLayer() + + + + + + + + + + + + + + + + + + + private bool VerifyAdornerLayer() { - if( _adorner.Parent != null ) + if( m_adorner.Parent != null ) + { return true; + } - AdornerLayer layer = AdornerLayer.GetAdornerLayer( _richTextBox ); + AdornerLayer layer = AdornerLayer.GetAdornerLayer( m_richTextBox ); if( layer == null ) + { return false; + } - layer.Add( _adorner ); + layer.Add( m_adorner ); return true; } - void HideAdorner() + private void HideAdorner() { - if( IsAdornerVisible ) + + if( this.IsAdornerVisible ) { - _adorner.Visibility = Visibility.Collapsed; - //_adorner.Child = null; - if( _parentWindow != null ) + m_adorner.Visibility = Visibility.Collapsed; + if( m_parentWindow != null ) { - Mouse.RemoveMouseMoveHandler( _parentWindow, OnPreviewMouseMoveParentWindow ); + Mouse.RemoveMouseMoveHandler( m_parentWindow, this.OnPreviewMouseMoveParentWindow ); } } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero/Buttons_NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero/Buttons_NormalColor.xaml index de7ba1b2..02e41f9f 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero/Buttons_NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero/Buttons_NormalColor.xaml @@ -18,35 +18,40 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero2/Buttons.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero2/Buttons.xaml index 6f21955a..7a72c117 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero2/Buttons.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero2/Buttons.xaml @@ -18,35 +18,40 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Generic/Buttons.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Generic/Buttons.xaml index 02c03987..8e846630 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Generic/Buttons.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Generic/Buttons.xaml @@ -18,33 +18,36 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml index 640c9f63..31186c35 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml @@ -20,6 +20,7 @@ xmlns:local="clr-namespace:Xceed.Wpf.Toolkit" xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes" xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes" + xmlns:core="clr-namespace:Xceed.Wpf.Toolkit.Core" xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters" xmlns:sys="clr-namespace:System;assembly=mscorlib"> @@ -46,7 +47,7 @@ + + ShowSpinner="{TemplateBinding ShowButtonSpinner}" + CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CornerRadius, Converter={conv:CornerRadiusReplacementConverter Auto, 0, 0, Auto}}"> + + + @@ -74,7 +75,7 @@ + + ShowSpinner="{TemplateBinding ShowButtonSpinner}" + CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CornerRadius, Converter={conv:CornerRadiusReplacementConverter Auto, 0, 0, Auto}}"> + + + - - - + + + - - - + + + - + - + BorderThickness="0" + Background="Transparent" + CaretBrush="{Binding CaretBrush, RelativeSource={RelativeSource TemplatedParent}}" + ContextMenu="{TemplateBinding ContextMenu}" + FontFamily="{TemplateBinding FontFamily}" + FontSize="{TemplateBinding FontSize}" + FontStretch="{TemplateBinding FontStretch}" + FontStyle="{TemplateBinding FontStyle}" + FontWeight="{TemplateBinding FontWeight}" + Foreground="{TemplateBinding Foreground}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}" + IsTabStop="True" + MinWidth="20" + AcceptsReturn="False" + Padding="{TemplateBinding Padding}" + TextAlignment="{TemplateBinding TextAlignment}" + TextWrapping="NoWrap" + TabIndex="{TemplateBinding TabIndex}" + Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" + Watermark="{TemplateBinding Watermark}" + WatermarkTemplate="{TemplateBinding WatermarkTemplate}" /> + + + + + + + + + + + + + + + + + + + + + + + -