Skip to content

Commit 53b3784

Browse files
committed
Updated header information and namespace for controls : Calendar, DataGrid, DatePicker, Expander, MenuItem, RichTextBox, ScrollBar, ScrollViewer, Separator
1 parent 7a0ac50 commit 53b3784

File tree

9 files changed

+90
-83
lines changed

9 files changed

+90
-83
lines changed

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Win11/Styles/Calendar.xaml

+12-13
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
<ResourceDictionary
99
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
10-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
11-
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework">
10+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
1211

1312
<!--
1413
TODO:
@@ -327,7 +326,7 @@
327326
<ColumnDefinition Width="Auto" />
328327
<ColumnDefinition Width="Auto" />
329328
</Grid.ColumnDefinitions>
330-
<controls:Button
329+
<Button
331330
x:Name="PART_HeaderButton"
332331
Grid.Column="0"
333332
Margin="-6,0,0,0"
@@ -341,7 +340,7 @@
341340
FontSize="14"
342341
FontWeight="Bold"
343342
Foreground="{DynamicResource CalendarViewForeground}" />
344-
<controls:Button
343+
<Button
345344
x:Name="PART_PreviousButton"
346345
Grid.Column="1"
347346
Width="26"
@@ -356,14 +355,14 @@
356355
Content=""
357356
Focusable="False"
358357
Foreground="{DynamicResource CalendarViewButtonForeground}">
359-
<controls:Button.Icon>
360-
<controls:SymbolIcon
358+
<Button.Icon>
359+
<SymbolIcon
361360
Filled="True"
362361
FontSize="26"
363362
Symbol="CaretUp20" />
364-
</controls:Button.Icon>
365-
</controls:Button>
366-
<controls:Button
363+
</Button.Icon>
364+
</Button>
365+
<Button
367366
x:Name="PART_NextButton"
368367
Grid.Column="2"
369368
Width="26"
@@ -378,13 +377,13 @@
378377
Content=""
379378
Focusable="False"
380379
Foreground="{DynamicResource CalendarViewButtonForeground}">
381-
<controls:Button.Icon>
382-
<controls:SymbolIcon
380+
<Button.Icon>
381+
<SymbolIcon
383382
Filled="True"
384383
FontSize="26"
385384
Symbol="CaretDown20" />
386-
</controls:Button.Icon>
387-
</controls:Button>
385+
</Button.Icon>
386+
</Button>
388387
</Grid>
389388

390389
<!-- HINT: Day picker -->

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Win11/Styles/DataGrid.xaml

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<!--
2+
Copyright (c) Microsoft. All rights reserved.
3+
This code is licensed under the MIT License (MIT).
4+
THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
5+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
7+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
8+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
9+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
10+
THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
11+
212
This Source Code Form is subject to the terms of the MIT License.
313
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
414
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
515
All Rights Reserved.
6-
7-
Based on Microsoft XAML for Win UI
8-
Copyright (c) Microsoft Corporation. All Rights Reserved.
916
-->
1017

1118
<ResourceDictionary
1219
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1320
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
14-
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
1521
xmlns:system="clr-namespace:System;assembly=System.Runtime">
1622

1723
<!--
@@ -567,7 +573,7 @@
567573

568574
<!-- <ContentPresenter Content="{TemplateBinding Content}" /> -->
569575

570-
<controls:SymbolIcon
576+
<SymbolIcon
571577
x:Name="SortIcon"
572578
Grid.Column="1"
573579
HorizontalAlignment="Center"
@@ -663,8 +669,8 @@
663669
BorderThickness="{TemplateBinding BorderThickness}"
664670
CornerRadius="{TemplateBinding Border.CornerRadius}"
665671
SnapsToDevicePixels="True">
666-
<ScrollViewer x:Name="DG_ScrollViewer" Focusable="False">
667-
<ScrollViewer.Template>
672+
<PassiveScrollViewer x:Name="DG_ScrollViewer" Focusable="False">
673+
<PassiveScrollViewer.Template>
668674
<ControlTemplate TargetType="{x:Type ScrollViewer}">
669675
<Grid>
670676
<Grid.ColumnDefinitions>
@@ -726,9 +732,9 @@
726732
</Grid>
727733
</Grid>
728734
</ControlTemplate>
729-
</ScrollViewer.Template>
735+
</PassiveScrollViewer.Template>
730736
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
731-
</ScrollViewer>
737+
</PassiveScrollViewer>
732738
<VisualStateManager.VisualStateGroups>
733739
<VisualStateGroup x:Name="CommonStates">
734740
<VisualState x:Name="Disabled">
@@ -752,7 +758,7 @@
752758
</Style.Triggers>
753759
</Style>
754760

755-
<controls:FallbackBrushConverter x:Key="FallbackBrushConverter" />
761+
<FallbackBrushConverter x:Key="FallbackBrushConverter" />
756762

757763
<Color x:Key="FallbackColor">#FFFF0000</Color>
758764

@@ -809,7 +815,7 @@
809815
BorderThickness="{TemplateBinding BorderThickness}"
810816
CornerRadius="{TemplateBinding Border.CornerRadius}">
811817
<Grid>
812-
<controls:SymbolIcon
818+
<SymbolIcon
813819
x:Name="ControlIcon"
814820
Margin="0"
815821
HorizontalAlignment="Center"
@@ -818,10 +824,10 @@
818824
FontWeight="Bold"
819825
Symbol="Checkmark48"
820826
Visibility="Collapsed">
821-
<controls:SymbolIcon.Foreground>
827+
<SymbolIcon.Foreground>
822828
<SolidColorBrush Color="{DynamicResource TextOnAccentFillColorPrimary}" />
823-
</controls:SymbolIcon.Foreground>
824-
</controls:SymbolIcon>
829+
</SymbolIcon.Foreground>
830+
</SymbolIcon>
825831
</Grid>
826832
</Border>
827833
</BulletDecorator.Bullet>
@@ -907,13 +913,13 @@
907913
<Style
908914
x:Key="DefaultUiDataGridStyle"
909915
BasedOn="{StaticResource DefaultDataGridStyle}"
910-
TargetType="{x:Type controls:DataGrid}">
916+
TargetType="{x:Type DataGrid}">
911917
<Setter Property="CheckBoxColumnEditingElementStyle" Value="{StaticResource DataGridCheckBoxEditingElementDefaultStyle}" />
912918
<Setter Property="CheckBoxColumnElementStyle" Value="{StaticResource DataGridCheckBoxElementDefaultStyle}" />
913919
</Style>
914920

915921
<Style BasedOn="{StaticResource DefaultDataGridColumnHeadersPresenterStyle}" TargetType="{x:Type DataGridColumnHeadersPresenter}" />
916922
<!--<Style BasedOn="{StaticResource DefaultDataGridStyle}" TargetType="{x:Type DataGrid}" />-->
917-
<Style BasedOn="{StaticResource DefaultUiDataGridStyle}" TargetType="{x:Type controls:DataGrid}" />
923+
<Style BasedOn="{StaticResource DefaultUiDataGridStyle}" TargetType="{x:Type DataGrid}" />
918924

919925
</ResourceDictionary>

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Win11/Styles/DatePicker.xaml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
<!--
1+
<!--
2+
This Source Code Form is subject to the terms of the MIT License.
3+
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
4+
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
5+
All Rights Reserved.
6+
27
Based on Microsoft XAML for Win UI
38
Copyright (c) Microsoft Corporation. All Rights Reserved.
49
-->
510

611
<ResourceDictionary
712
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
813
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
9-
xmlns:controls="clr-namespace:System.Windows;assembly=PresentationFramework"
10-
xmlns:symbol="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
1114
xmlns:system="clr-namespace:System;assembly=mscorlib">
1215

1316
<Thickness x:Key="DatePickerBorderThemeThickness">1,1,1,0</Thickness>
@@ -132,7 +135,7 @@
132135
BorderBrush="Transparent"
133136
Cursor="Arrow">
134137
<!-- WPF overrides paddings for button -->
135-
<symbol:SymbolIcon
138+
<SymbolIcon
136139
Margin="{StaticResource DatePickerCalendarButtonPadding}"
137140
HorizontalAlignment="Center"
138141
VerticalAlignment="Center"

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Win11/Styles/Expander.xaml

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
<!--
1+
<!--
2+
This Source Code Form is subject to the terms of the MIT License.
3+
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
4+
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
5+
All Rights Reserved.
6+
27
Based on Microsoft XAML for Win UI
38
Copyright (c) Microsoft Corporation. All Rights Reserved.
49
-->
510

6-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
7-
xmlns:system="clr-namespace:System;assembly=System.Runtime"
8-
xmlns:controls="clr-namespace:System.Windows;assembly=PresentationFramework"
9-
xmlns:symbol="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
10-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
11+
<ResourceDictionary
12+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
13+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
14+
xmlns:system="clr-namespace:System;assembly=System.Runtime">
1115

1216
<Thickness x:Key="ExpanderPadding">11,11,11,11</Thickness>
1317
<Thickness x:Key="ExpanderBorderThemeThickness">1</Thickness>
@@ -36,7 +40,7 @@
3640
<Grid.RenderTransform>
3741
<RotateTransform Angle="0" />
3842
</Grid.RenderTransform>
39-
<symbol:SymbolIcon
43+
<SymbolIcon
4044
x:Name="ControlChevronIcon"
4145
FontSize="{StaticResource ExpanderChevronSize}"
4246
Foreground="{TemplateBinding Foreground}"
@@ -92,7 +96,7 @@
9296
<Setter.Value>
9397
<ControlTemplate TargetType="{x:Type Expander}">
9498
<ControlTemplate.Resources>
95-
<controls:AnimationFactorToValueConverter x:Key="AnimationFactorToValueConverter" />
99+
<AnimationFactorToValueConverter x:Key="AnimationFactorToValueConverter" />
96100
</ControlTemplate.Resources>
97101

98102
<Grid>
@@ -212,4 +216,3 @@
212216
<Style BasedOn="{StaticResource DefaultExpanderStyle}" TargetType="{x:Type Expander}" />
213217

214218
</ResourceDictionary>
215-

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Win11/Styles/MenuItem.xaml

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
<ResourceDictionary
99
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
10-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
11-
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework">
10+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
1211

1312
<Style
1413
x:Key="UiMenuItemScrollViewer"
@@ -324,7 +323,7 @@
324323
RecognizesAccessKey="True" />
325324

326325
<Grid Grid.Column="2">
327-
<controls:SymbolIcon
326+
<SymbolIcon
328327
x:Name="Chevron"
329328
Margin="0,3,0,0"
330329
VerticalAlignment="Center"
@@ -443,7 +442,7 @@
443442
-->
444443

445444
<!-- TopLevelHeader -->
446-
<ControlTemplate x:Key="WpfUiMenuItemTopLevelHeaderTemplateKey" TargetType="{x:Type controls:MenuItem}">
445+
<ControlTemplate x:Key="WpfUiMenuItemTopLevelHeaderTemplateKey" TargetType="{x:Type MenuItem}">
447446
<Border
448447
x:Name="Border"
449448
Margin="4"
@@ -560,7 +559,7 @@
560559
</ControlTemplate>
561560

562561
<!-- TopLevelItem -->
563-
<ControlTemplate x:Key="WpfUiMenuItemTopLevelItemTemplateKey" TargetType="{x:Type controls:MenuItem}">
562+
<ControlTemplate x:Key="WpfUiMenuItemTopLevelItemTemplateKey" TargetType="{x:Type MenuItem}">
564563
<Border
565564
x:Name="Border"
566565
Margin="4"
@@ -613,7 +612,7 @@
613612
</ControlTemplate>
614613

615614
<!-- SubmenuItem -->
616-
<ControlTemplate x:Key="WpfUiMenuItemSubmenuItemTemplateKey" TargetType="{x:Type controls:MenuItem}">
615+
<ControlTemplate x:Key="WpfUiMenuItemSubmenuItemTemplateKey" TargetType="{x:Type MenuItem}">
617616
<Border
618617
x:Name="Border"
619618
Margin="4,1,4,1"
@@ -704,7 +703,7 @@
704703
</ControlTemplate>
705704

706705
<!-- SubItem with Subitems -->
707-
<ControlTemplate x:Key="WpfUiMenuItemSubmenuHeaderTemplateKey" TargetType="{x:Type controls:MenuItem}">
706+
<ControlTemplate x:Key="WpfUiMenuItemSubmenuHeaderTemplateKey" TargetType="{x:Type MenuItem}">
708707
<Grid>
709708
<Grid.RowDefinitions>
710709
<RowDefinition Height="*" />
@@ -740,7 +739,7 @@
740739
RecognizesAccessKey="True" />
741740

742741
<Grid Grid.Column="3">
743-
<controls:SymbolIcon
742+
<SymbolIcon
744743
x:Name="Chevron"
745744
Margin="0,3,0,0"
746745
VerticalAlignment="Center"
@@ -833,7 +832,7 @@
833832
</ControlTemplate>
834833

835834
<!-- MenuItem Style -->
836-
<Style x:Key="WpfUiMenuItem" TargetType="{x:Type controls:MenuItem}">
835+
<Style x:Key="WpfUiMenuItem" TargetType="{x:Type MenuItem}">
837836
<Setter Property="OverridesDefaultStyle" Value="True" />
838837
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
839838
<Setter Property="KeyboardNavigation.IsTabStop" Value="True" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Win11/Styles/RichTextBox.xaml

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<!--
2-
Based on Microsoft XAML for Win UI
3-
Copyright (c) Microsoft Corporation. All Rights Reserved.
1+
<!--
2+
This Source Code Form is subject to the terms of the MIT License.
3+
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
4+
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
5+
All Rights Reserved.
46
-->
57

68
<ResourceDictionary
79
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
8-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
9-
xmlns:controls="clr-namespace:System.Windows;assembly=PresentationFramework">
10+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
1011

1112
<Style x:Key="DefaultRichTextBoxStyle" TargetType="{x:Type RichTextBox}">
1213
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
@@ -33,7 +34,7 @@
3334
BorderThickness="{TemplateBinding BorderThickness}"
3435
CornerRadius="4"
3536
Focusable="False">
36-
<ScrollViewer
37+
<PassiveScrollViewer
3738
x:Name="PART_ContentHost"
3839
Margin="0,0,2,0"
3940
Padding="{TemplateBinding Padding}"
@@ -67,8 +68,7 @@
6768
TargetType="{x:Type RichTextBox}">
6869

6970
<Style.Triggers>
70-
<Trigger Property="TextBox.IsTextSelectionEnabled" Value="True">
71-
<Setter Property="IsReadOnly" Value="False" />
71+
<Trigger Property="TextBox.IsTextSelectionEnabled" Value="True">
7272
<Setter Property="Background" Value="Transparent" />
7373
<Setter Property="Padding" Value="0" />
7474
<Setter Property="BorderBrush" Value="Transparent" />
@@ -77,8 +77,7 @@
7777
</Style.Triggers>
7878
</Style>
7979

80+
<!-- <Style BasedOn="{StaticResource DefaultRichTextBoxStyle}" TargetType="{x:Type RichTextBox}" /> -->
8081
<Style BasedOn="{StaticResource DefaultUiRichTextBoxStyle}" TargetType="{x:Type RichTextBox}" />
8182

82-
8383
</ResourceDictionary>
84-

0 commit comments

Comments
 (0)