Skip to content

Reorg layout #3714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,18 @@
<Compile Include="Common\Constants.cs" />
<Compile Include="Common\MetadataRegistrationBase.cs" />
<Compile Include="Common\PlatformTypes.cs" />
<Compile Include="Controls\BladeItem.Metadata.cs" />
<Compile Include="Controls\BladeItem.Typedata.cs" />
<Compile Include="Controls\BladeView.Metadata.cs" />
<Compile Include="Controls\BladeView.Typedata.cs" />
<Compile Include="Controls\Carousel.Metadata.cs" />
<Compile Include="Controls\Carousel.Typedata.cs" />
<Compile Include="Controls\DropShadowPanel.Metadata.cs" />
<Compile Include="Controls\DropShadowPanel.Typedata.cs" />
<Compile Include="Controls\Expander.Metadata.cs" />
<Compile Include="Controls\Expander.Typedata.cs" />
<Compile Include="Controls\GridSplitter.Metadata.cs" />
<Compile Include="Controls\GridSplitter.Typedata.cs" />
<Compile Include="Controls\ImageEx.Metadata.cs" />
<Compile Include="Controls\ImageEx.Typedata.cs" />
<Compile Include="Controls\InAppNotification.Metadata.cs" />
<Compile Include="Controls\InAppNotification.Typedata.cs" />
<Compile Include="Controls\LayoutTransitionControl.Metadata.cs" />
<Compile Include="Controls\LayoutTransitionControl.Typedata.cs" />
<Compile Include="Controls\Loading.Metadata.cs" />
<Compile Include="Controls\Loading.Typedata.cs" />
<Compile Include="Controls\ListDetailsView.Metadata.cs" />
<Compile Include="Controls\ListDetailsView.Typedata.cs" />
<Compile Include="Controls\Menu.Metadata.cs" />
<Compile Include="Controls\Menu.Typedata.cs" />
<Compile Include="Controls\MenuItem.Metadata.cs" />
<Compile Include="Controls\MenuItem.Typedata.cs" />
<Compile Include="Controls\OrbitView.Metadata.cs" />
<Compile Include="Controls\OrbitView.Typedata.cs" />
<Compile Include="Controls\RadialGauge.Metadata.cs" />
<Compile Include="Controls\RadialGauge.Typedata.cs" />
<Compile Include="Controls\RadialProgressBar.Metadata.cs" />
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,4 @@
<data name="CategoryDropShadow" xml:space="preserve">
<value>Drop Shadow</value>
</data>
<data name="CategoryInteractions" xml:space="preserve">
<value>Interactions</value>
</data>
<data name="CategoryMarkdownCodeStyle" xml:space="preserve">
<value>Markdown Style - Code</value>
</data>
<data name="CategoryMarkdownHeaderStyle" xml:space="preserve">
<value>Markdown Style - Header {0}</value>
</data>
<data name="CategoryMarkdownListStyle" xml:space="preserve">
<value>Markdown Style - List</value>
</data>
<data name="CategoryMarkdownQuoteStyle" xml:space="preserve">
<value>Markdown Style - Quote</value>
</data>
<data name="CategoryMarkdownStyle" xml:space="preserve">
<value>Markdown Style</value>
</data>
<data name="CategoryMarkdownTableStyle" xml:space="preserve">
<value>Markdown Style - Table</value>
</data>
<data name="CategoryText" xml:space="preserve">
<value>Text</value>
</data>
</root>
85 changes: 59 additions & 26 deletions Microsoft.Toolkit.Uwp.UI.Controls.Core/Menu/MenuItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// Menu Item is the items main container for Class Menu control
/// </summary>
[Obsolete("This control will be removed in a future major release. Please use the MenuBar control from the WinUI Library instead.")]
public class MenuItem : HeaderedItemsControl
public class MenuItem : ItemsControl
{
private const string FlyoutButtonName = "FlyoutButton";
private const char UnderlineCharacter = '^';
Expand All @@ -49,6 +49,39 @@ private object InternalHeader
}
}

/// <summary>
/// Gets or sets the header of each control.
/// </summary>
public object Header
{
get { return (object)GetValue(HeaderProperty); }
set { SetValue(HeaderProperty, value); }
}

/// <summary>
/// Identifies the <see cref="Header"/> dependency property.
/// </summary>
public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register(nameof(Header), typeof(object), typeof(MenuItem), new PropertyMetadata(null, OnHeaderChanged));

/// <summary>
/// Gets or sets the template used to display the content of the control's header.
/// </summary>
public DataTemplate HeaderTemplate
{
get { return (DataTemplate)GetValue(HeaderTemplateProperty); }
set { SetValue(HeaderTemplateProperty, value); }
}

/// <summary>
/// Identifies the <see cref="HeaderTemplate"/> dependency property.
/// </summary>
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
nameof(HeaderTemplate),
typeof(DataTemplate),
typeof(MenuItem),
new PropertyMetadata(null));

/// <summary>
/// Gets a value indicating whether the menu is opened or not
/// </summary>
Expand Down Expand Up @@ -497,40 +530,40 @@ internal void Underline()
InternalHeader = text;
}

/// <inheritdoc />
protected override void OnHeaderChanged(object oldValue, object newValue)
private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
base.OnHeaderChanged(oldValue, newValue);

if (_isInternalHeaderUpdate)
if (d is MenuItem menuitem)
{
return;
}
if (menuitem._isInternalHeaderUpdate)
{
return;
}

_originalHeader = null;
menuitem._originalHeader = null;

var headerString = newValue as string;
var headerString = e.NewValue as string;

if (string.IsNullOrEmpty(headerString))
{
return;
}
if (string.IsNullOrEmpty(headerString))
{
return;
}

var underlineCharacterIndex = headerString.IndexOf(UnderlineCharacter);
var underlineCharacterIndex = headerString.IndexOf(UnderlineCharacter);

if (underlineCharacterIndex == -1)
{
return;
}
if (underlineCharacterIndex == -1)
{
return;
}

if (underlineCharacterIndex == headerString.Length - 1)
{
InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
return;
}
if (underlineCharacterIndex == headerString.Length - 1)
{
menuitem.InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
return;
}

_originalHeader = headerString;
InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
menuitem._originalHeader = headerString;
menuitem.InternalHeader = headerString.Replace(UnderlineCharacter.ToString(), string.Empty);
}
}

internal void RemoveUnderline()
Expand Down
18 changes: 18 additions & 0 deletions Microsoft.Toolkit.Uwp.UI.Controls.Core/Menu/MenuItem.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
<Style TargetType="controls:MenuItem">
<Setter Property="Padding" Value="2,0,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:MenuItem">
<StackPanel>
<ContentPresenter Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}" />
<ItemsPresenter Margin="{TemplateBinding Padding}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,12 @@
This library provides XAML templated controls. It is part of the Windows Community Toolkit.

Controls:
- BladeView: Provides a horizontal collection of blades for master-detail scenarios.
- CameraPreview: Easily preview video from camera sources and get realtime frames from the selected source.
- Carousel: Presents items in a carousel control.
- ColorPicker/ColorPickerButton: Improved ColorPicker and DropDownButton version.
- DropShadowPanel: DropShadowPanel control allows the creation of a DropShadow for any Xaml FrameworkElement in markup.
- Expander: Expander allows user to show/hide content based on a boolean state.
- GridSplitter: A the control that redistributes space between columns or rows of a Grid control.
- HeaderedContentControl: Provides a header to content.
- HeaderedItemsControl: Provides a header to items.
- ImageEx: Images are downloaded asynchronously showing a load indicator and can be stored in a local cache.
- InAppNotification: Show local notifications in your application.
- LayoutTransformControl: Support for transformations as if applied by LayoutTransform.
- Loading: Helps to show content with animation to the user while the app is doing some calculation.
- ListDetailsView: Implements the List/Details design pattern.
- OrbitView: Positions items in a circle around a center element and supports orbits and anchors.
- RadialGauge: Displays a value within a range, using a needle on a circular face.
- RadialProgressBar: Displays progress as a circle getting filled.
- RangeSelector: "Double slider" control for range values.
Expand All @@ -31,7 +22,7 @@
- TileControl: A ContentControl that show an image repeated many times.
- TokenizingTextBox: An AutoSuggestBox like control which places entered input into easily removed containers for contacts or tags.
</Description>
<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>
<PackageTags>UWP Toolkit Windows Controls XAML Range Markdown CameraPreview Camera DropShadow ImageEx InAppNotification InfiniteCanvas Radial Gauge RadiaGauge RadialProgressBar Scroll ScrollHeader Tile Tokenizing TextBox</PackageTags>
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
<LangVersion>8.0</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<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">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=bladeview/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=dropshadowpanel/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=gridsplitter/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=hamburgermenu/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=hamburgermenu_005Cmenuitems/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=imageex/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,6 @@
<value>Warning</value>
<comment>Label for TextToolbar Control Warning message.</comment>
</data>
<data name="WCT_BladeView_ExpandButton_Collapsed" xml:space="preserve">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to update the strings, see f3547fe, not sure if you want to cherry-pick or just have that forward-fixed?

<value>Collapse Blade</value>
<comment>Narrator Resource for BladeView collapsed status</comment>
</data>
<data name="WCT_BladeView_ExpandButton_Expanded" xml:space="preserve">
<value>Expand Blade</value>
<comment>Narrator Resource for BladeView expanded status</comment>
</data>
<data name="WCT_GridSplitter_AutomationName" xml:space="preserve">
<value>GridSplitter</value>
<comment>Narrator Resource for GridSplitter control</comment>
</data>
<data name="WCT_InAppNotification_DismissButton_AutomationName" xml:space="preserve">
<value>Dismiss</value>
<comment>The automation name for the dismiss button of the InAppNotification control.</comment>
Expand All @@ -221,4 +209,4 @@
<value>Select All</value>
<comment>Label for TokenizingTextBox MenuFlyout 'Select All' option.</comment>
</data>
</root>
</root>
9 changes: 0 additions & 9 deletions Microsoft.Toolkit.Uwp.UI.Controls.Core/Themes/Generic.xaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/BladeView/BladeView.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/CameraPreview/CameraPreview.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Carousel/Carousel.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ColorPicker/ColorPicker.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ColorPicker/ColorPickerButton.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ColorPicker/ColorPickerSlider.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/DropShadowPanel/DropShadowPanel.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Expander/Expander.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/GridSplitter/GridSplitter.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/HeaderedContentControl/HeaderedContentControl.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/HeaderedItemsControl/HeaderedItemsControl.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ImageEx/ImageEx.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/InAppNotification.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/LayoutTransformControl/LayoutTransformControl.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Loading/Loading.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/ListDetailsView/ListDetailsView.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/Menu/Menu.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/OrbitView/OrbitView.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/RadialGauge/RadialGauge.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/RadialProgressBar/RadialProgressBar.xaml" />
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/RangeSelector/RangeSelector.xaml" />
Expand Down
Loading