Skip to content

Commit 7463d9f

Browse files
Merge pull request #3714 from RosarioPulella/reorg-layout
Reorg layout
2 parents b3babef + 7c7d1ef commit 7463d9f

File tree

108 files changed

+1031
-359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1031
-359
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Microsoft.Toolkit.Uwp.UI.Controls.Core.DesignTools.csproj

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,34 +79,18 @@
7979
<Compile Include="Common\Constants.cs" />
8080
<Compile Include="Common\MetadataRegistrationBase.cs" />
8181
<Compile Include="Common\PlatformTypes.cs" />
82-
<Compile Include="Controls\BladeItem.Metadata.cs" />
83-
<Compile Include="Controls\BladeItem.Typedata.cs" />
84-
<Compile Include="Controls\BladeView.Metadata.cs" />
85-
<Compile Include="Controls\BladeView.Typedata.cs" />
86-
<Compile Include="Controls\Carousel.Metadata.cs" />
87-
<Compile Include="Controls\Carousel.Typedata.cs" />
8882
<Compile Include="Controls\DropShadowPanel.Metadata.cs" />
8983
<Compile Include="Controls\DropShadowPanel.Typedata.cs" />
90-
<Compile Include="Controls\Expander.Metadata.cs" />
91-
<Compile Include="Controls\Expander.Typedata.cs" />
92-
<Compile Include="Controls\GridSplitter.Metadata.cs" />
93-
<Compile Include="Controls\GridSplitter.Typedata.cs" />
9484
<Compile Include="Controls\ImageEx.Metadata.cs" />
9585
<Compile Include="Controls\ImageEx.Typedata.cs" />
9686
<Compile Include="Controls\InAppNotification.Metadata.cs" />
9787
<Compile Include="Controls\InAppNotification.Typedata.cs" />
98-
<Compile Include="Controls\LayoutTransitionControl.Metadata.cs" />
99-
<Compile Include="Controls\LayoutTransitionControl.Typedata.cs" />
10088
<Compile Include="Controls\Loading.Metadata.cs" />
10189
<Compile Include="Controls\Loading.Typedata.cs" />
102-
<Compile Include="Controls\ListDetailsView.Metadata.cs" />
103-
<Compile Include="Controls\ListDetailsView.Typedata.cs" />
10490
<Compile Include="Controls\Menu.Metadata.cs" />
10591
<Compile Include="Controls\Menu.Typedata.cs" />
10692
<Compile Include="Controls\MenuItem.Metadata.cs" />
10793
<Compile Include="Controls\MenuItem.Typedata.cs" />
108-
<Compile Include="Controls\OrbitView.Metadata.cs" />
109-
<Compile Include="Controls\OrbitView.Typedata.cs" />
11094
<Compile Include="Controls\RadialGauge.Metadata.cs" />
11195
<Compile Include="Controls\RadialGauge.Typedata.cs" />
11296
<Compile Include="Controls\RadialProgressBar.Metadata.cs" />

Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Properties/Resources.Designer.cs

Lines changed: 0 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Properties/Resources.resx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -129,28 +129,4 @@
129129
<data name="CategoryDropShadow" xml:space="preserve">
130130
<value>Drop Shadow</value>
131131
</data>
132-
<data name="CategoryInteractions" xml:space="preserve">
133-
<value>Interactions</value>
134-
</data>
135-
<data name="CategoryMarkdownCodeStyle" xml:space="preserve">
136-
<value>Markdown Style - Code</value>
137-
</data>
138-
<data name="CategoryMarkdownHeaderStyle" xml:space="preserve">
139-
<value>Markdown Style - Header {0}</value>
140-
</data>
141-
<data name="CategoryMarkdownListStyle" xml:space="preserve">
142-
<value>Markdown Style - List</value>
143-
</data>
144-
<data name="CategoryMarkdownQuoteStyle" xml:space="preserve">
145-
<value>Markdown Style - Quote</value>
146-
</data>
147-
<data name="CategoryMarkdownStyle" xml:space="preserve">
148-
<value>Markdown Style</value>
149-
</data>
150-
<data name="CategoryMarkdownTableStyle" xml:space="preserve">
151-
<value>Markdown Style - Table</value>
152-
</data>
153-
<data name="CategoryText" xml:space="preserve">
154-
<value>Text</value>
155-
</data>
156132
</root>

Microsoft.Toolkit.Uwp.UI.Controls.Core/Menu/MenuItem.cs

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
2222
/// Menu Item is the items main container for Class Menu control
2323
/// </summary>
2424
[Obsolete("This control will be removed in a future major release. Please use the MenuBar control from the WinUI Library instead.")]
25-
public class MenuItem : HeaderedItemsControl
25+
public class MenuItem : ItemsControl
2626
{
2727
private const string FlyoutButtonName = "FlyoutButton";
2828
private const char UnderlineCharacter = '^';
@@ -49,6 +49,39 @@ private object InternalHeader
4949
}
5050
}
5151

52+
/// <summary>
53+
/// Gets or sets the header of each control.
54+
/// </summary>
55+
public object Header
56+
{
57+
get { return (object)GetValue(HeaderProperty); }
58+
set { SetValue(HeaderProperty, value); }
59+
}
60+
61+
/// <summary>
62+
/// Identifies the <see cref="Header"/> dependency property.
63+
/// </summary>
64+
public static readonly DependencyProperty HeaderProperty =
65+
DependencyProperty.Register(nameof(Header), typeof(object), typeof(MenuItem), new PropertyMetadata(null, OnHeaderChanged));
66+
67+
/// <summary>
68+
/// Gets or sets the template used to display the content of the control's header.
69+
/// </summary>
70+
public DataTemplate HeaderTemplate
71+
{
72+
get { return (DataTemplate)GetValue(HeaderTemplateProperty); }
73+
set { SetValue(HeaderTemplateProperty, value); }
74+
}
75+
76+
/// <summary>
77+
/// Identifies the <see cref="HeaderTemplate"/> dependency property.
78+
/// </summary>
79+
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
80+
nameof(HeaderTemplate),
81+
typeof(DataTemplate),
82+
typeof(MenuItem),
83+
new PropertyMetadata(null));
84+
5285
/// <summary>
5386
/// Gets a value indicating whether the menu is opened or not
5487
/// </summary>
@@ -497,40 +530,40 @@ internal void Underline()
497530
InternalHeader = text;
498531
}
499532

500-
/// <inheritdoc />
501-
protected override void OnHeaderChanged(object oldValue, object newValue)
533+
private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
502534
{
503-
base.OnHeaderChanged(oldValue, newValue);
504-
505-
if (_isInternalHeaderUpdate)
535+
if (d is MenuItem menuitem)
506536
{
507-
return;
508-
}
537+
if (menuitem._isInternalHeaderUpdate)
538+
{
539+
return;
540+
}
509541

510-
_originalHeader = null;
542+
menuitem._originalHeader = null;
511543

512-
var headerString = newValue as string;
544+
var headerString = e.NewValue as string;
513545

514-
if (string.IsNullOrEmpty(headerString))
515-
{
516-
return;
517-
}
546+
if (string.IsNullOrEmpty(headerString))
547+
{
548+
return;
549+
}
518550

519-
var underlineCharacterIndex = headerString.IndexOf(UnderlineCharacter);
551+
var underlineCharacterIndex = headerString.IndexOf(UnderlineCharacter);
520552

521-
if (underlineCharacterIndex == -1)
522-
{
523-
return;
524-
}
553+
if (underlineCharacterIndex == -1)
554+
{
555+
return;
556+
}
525557

526-
if (underlineCharacterIndex == headerString.Length - 1)
527-
{
528-
InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
529-
return;
530-
}
558+
if (underlineCharacterIndex == headerString.Length - 1)
559+
{
560+
menuitem.InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
561+
return;
562+
}
531563

532-
_originalHeader = headerString;
533-
InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
564+
menuitem._originalHeader = headerString;
565+
menuitem.InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
566+
}
534567
}
535568

536569
internal void RemoveUnderline()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
4+
<Style TargetType="controls:MenuItem">
5+
<Setter Property="Padding" Value="2,0,0,0" />
6+
<Setter Property="Template">
7+
<Setter.Value>
8+
<ControlTemplate TargetType="controls:MenuItem">
9+
<StackPanel>
10+
<ContentPresenter Content="{TemplateBinding Header}"
11+
ContentTemplate="{TemplateBinding HeaderTemplate}" />
12+
<ItemsPresenter Margin="{TemplateBinding Padding}" />
13+
</StackPanel>
14+
</ControlTemplate>
15+
</Setter.Value>
16+
</Setter>
17+
</Style>
18+
</ResourceDictionary>

Microsoft.Toolkit.Uwp.UI.Controls.Core/Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,12 @@
77
This library provides XAML templated controls. It is part of the Windows Community Toolkit.
88

99
Controls:
10-
- BladeView: Provides a horizontal collection of blades for master-detail scenarios.
1110
- CameraPreview: Easily preview video from camera sources and get realtime frames from the selected source.
12-
- Carousel: Presents items in a carousel control.
1311
- ColorPicker/ColorPickerButton: Improved ColorPicker and DropDownButton version.
1412
- DropShadowPanel: DropShadowPanel control allows the creation of a DropShadow for any Xaml FrameworkElement in markup.
15-
- Expander: Expander allows user to show/hide content based on a boolean state.
16-
- GridSplitter: A the control that redistributes space between columns or rows of a Grid control.
17-
- HeaderedContentControl: Provides a header to content.
18-
- HeaderedItemsControl: Provides a header to items.
1913
- ImageEx: Images are downloaded asynchronously showing a load indicator and can be stored in a local cache.
2014
- InAppNotification: Show local notifications in your application.
21-
- LayoutTransformControl: Support for transformations as if applied by LayoutTransform.
2215
- Loading: Helps to show content with animation to the user while the app is doing some calculation.
23-
- ListDetailsView: Implements the List/Details design pattern.
24-
- OrbitView: Positions items in a circle around a center element and supports orbits and anchors.
2516
- RadialGauge: Displays a value within a range, using a needle on a circular face.
2617
- RadialProgressBar: Displays progress as a circle getting filled.
2718
- RangeSelector: "Double slider" control for range values.
@@ -31,7 +22,7 @@
3122
- TileControl: A ContentControl that show an image repeated many times.
3223
- TokenizingTextBox: An AutoSuggestBox like control which places entered input into easily removed containers for contacts or tags.
3324
</Description>
34-
<PackageTags>UWP Toolkit Windows Controls XAML Range Markdown BladeView Blade CameraPreview Camera Carousel DropShadow Expander GridSplitter HeaderedContent ImageEx InAppNotification InfiniteCanvas List Details ListDetails Orbit Radial Gauge RadiaGauge RadialProgressBar Scroll ScrollHeader Tile Tokenizing TextBox</PackageTags>
25+
<PackageTags>UWP Toolkit Windows Controls XAML Range Markdown CameraPreview Camera DropShadow ImageEx InAppNotification InfiniteCanvas Radial Gauge RadiaGauge RadialProgressBar Scroll ScrollHeader Tile Tokenizing TextBox</PackageTags>
3526
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
3627
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
3728
<LangVersion>8.0</LangVersion>

Microsoft.Toolkit.Uwp.UI.Controls.Core/Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj.DotSettings

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=bladeview/@EntryIndexedValue">True</s:Boolean>
32
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=dropshadowpanel/@EntryIndexedValue">True</s:Boolean>
4-
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=gridsplitter/@EntryIndexedValue">True</s:Boolean>
53
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=hamburgermenu/@EntryIndexedValue">True</s:Boolean>
64
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=hamburgermenu_005Cmenuitems/@EntryIndexedValue">True</s:Boolean>
75
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=imageex/@EntryIndexedValue">True</s:Boolean>

Microsoft.Toolkit.Uwp.UI.Controls.Core/Strings/en-US/Resources.resw

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,6 @@
193193
<value>Warning</value>
194194
<comment>Label for TextToolbar Control Warning message.</comment>
195195
</data>
196-
<data name="WCT_BladeView_ExpandButton_Collapsed" xml:space="preserve">
197-
<value>Collapse Blade</value>
198-
<comment>Narrator Resource for BladeView collapsed status</comment>
199-
</data>
200-
<data name="WCT_BladeView_ExpandButton_Expanded" xml:space="preserve">
201-
<value>Expand Blade</value>
202-
<comment>Narrator Resource for BladeView expanded status</comment>
203-
</data>
204-
<data name="WCT_GridSplitter_AutomationName" xml:space="preserve">
205-
<value>GridSplitter</value>
206-
<comment>Narrator Resource for GridSplitter control</comment>
207-
</data>
208196
<data name="WCT_InAppNotification_DismissButton_AutomationName" xml:space="preserve">
209197
<value>Dismiss</value>
210198
<comment>The automation name for the dismiss button of the InAppNotification control.</comment>
@@ -221,4 +209,4 @@
221209
<value>Select All</value>
222210
<comment>Label for TokenizingTextBox MenuFlyout 'Select All' option.</comment>
223211
</data>
224-
</root>
212+
</root>

Microsoft.Toolkit.Uwp.UI.Controls.Core/Themes/Generic.xaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
33
<ResourceDictionary.MergedDictionaries>
4-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/BladeView/BladeView.xaml" />
54
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/CameraPreview/CameraPreview.xaml" />
6-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Carousel/Carousel.xaml" />
75
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ColorPicker/ColorPicker.xaml" />
86
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ColorPicker/ColorPickerButton.xaml" />
97
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ColorPicker/ColorPickerSlider.xaml" />
108
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/DropShadowPanel/DropShadowPanel.xaml" />
11-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Expander/Expander.xaml" />
12-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/GridSplitter/GridSplitter.xaml" />
13-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/HeaderedContentControl/HeaderedContentControl.xaml" />
14-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/HeaderedItemsControl/HeaderedItemsControl.xaml" />
159
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ImageEx/ImageEx.xaml" />
1610
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/InAppNotification.xaml" />
17-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/LayoutTransformControl/LayoutTransformControl.xaml" />
1811
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Loading/Loading.xaml" />
19-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ListDetailsView/ListDetailsView.xaml" />
2012
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Menu/Menu.xaml" />
21-
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/OrbitView/OrbitView.xaml" />
2213
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/RadialGauge/RadialGauge.xaml" />
2314
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/RadialProgressBar/RadialProgressBar.xaml" />
2415
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/RangeSelector/RangeSelector.xaml" />

0 commit comments

Comments
 (0)