Merge branch 'master' into pr/3556
This commit is contained in:
Коммит
134d14e93d
|
@ -11,13 +11,18 @@ assignees: ''
|
|||
|
||||
## Describe the problem this feature would solve
|
||||
<!-- Please describe or link to any existing issues or discussions.
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||
A clear and concise description of what the problem is, starting with the user story.
|
||||
Provide examples of the restrictions in the current environment that hinders the work your users or you want to perform. What are the ways this new feature will help transform and deliver those results?
|
||||
For example, I am currently using the InfiniteCanvas control which lacks the ribbon control feature. I am looking to improve user experience therefore i would like to use that in my project to provide ease of accessibility and a user-friendly interface. This new feature will provide quick access to the toolbar, enhance space utilization, etc [...] -->
|
||||
|
||||
|
||||
## Describe the solution
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
<!-- A clear and concise description of what you want to happen. Define how do you think it will help the community and adds value to the toolkit? -->
|
||||
|
||||
|
||||
## Describe alternatives you've considered
|
||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||
|
||||
|
||||
## Additional context & Screenshots
|
||||
<!-- Add any other context or screenshots about the feature request here.-->
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->
|
||||
|
||||
<!-- 📝 It is preferred if you keep the "☑️ Allow edits by maintainers" checked in the Pull Request Template as it increases collaboration with the Toolkit maintainers by permitting commits to your PR branch (only) created from your fork. This can let us quickly make fixes for minor typos or forgotten StyleCop issues during review without needing to wait on you doing extra work. Let us help you help us! 🎉 -->
|
||||
|
||||
|
||||
## Fixes #
|
||||
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->
|
||||
|
||||
|
@ -35,6 +38,7 @@ Please check if your PR fulfills the following requirements:
|
|||
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
|
||||
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
|
||||
- [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
|
||||
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
|
||||
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
|
||||
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
|
||||
- [ ] Contains **NO** breaking changes
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
|
||||
<IsUwpProject Condition="'$(IsDesignProject)' != 'true'">$(MSBuildProjectName.Contains('Uwp'))</IsUwpProject>
|
||||
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
|
||||
<DefaultTargetPlatformVersion>19041</DefaultTargetPlatformVersion>
|
||||
<DefaultTargetPlatformMinVersion>17763</DefaultTargetPlatformMinVersion>
|
||||
<TargetPlatformBaseVersion>10.0</TargetPlatformBaseVersion>
|
||||
<TargetPlatformRevision>19041</TargetPlatformRevision>
|
||||
<TargetPlatformMinRevision>17763</TargetPlatformMinRevision>
|
||||
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -88,7 +89,6 @@
|
|||
</Choose>
|
||||
|
||||
<PropertyGroup Condition="'$(IsUwpProject)' == 'true'">
|
||||
|
||||
<!-- 8002 is a strong named -> non-strong-named reference -->
|
||||
<!-- This is valid for platforms other than .NET Framework (and is needed for the UWP targets -->
|
||||
<NoWarn>$(NoWarn);8002</NoWarn>
|
||||
|
@ -103,4 +103,7 @@
|
|||
<Link>stylecop.json</Link>
|
||||
</AdditionalFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.VisualStudio.Design.props" Condition="'$(IsDesignProject)' == 'true'"/>
|
||||
|
||||
</Project>
|
|
@ -1,26 +1,11 @@
|
|||
<Project>
|
||||
<Choose>
|
||||
<When Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">
|
||||
<!-- UAP versions for uap10.0 where TPMV isn't implied -->
|
||||
<PropertyGroup>
|
||||
<TargetPlatformVersion>10.0.$(DefaultTargetPlatformVersion).0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(DebugType)' == ''">
|
||||
<DebugType>Portable</DebugType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<UseUWP Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">true</UseUWP>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SDKReference Condition="'$(UseWindowsDesktopSdk)' == 'true' " Include="WindowsDesktop, Version=$(TargetPlatformVersion)">
|
||||
<Name>Windows Desktop Extensions for the UWP</Name>
|
||||
</SDKReference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
|
||||
<Choose>
|
||||
<When Condition="'$(TargetFramework.Contains(`uap10.0`))' == 'false' and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true'">
|
||||
<When Condition="!$(TargetFramework.Contains(`uap10.0`)) and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true'">
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
|
||||
|
@ -28,6 +13,8 @@
|
|||
</When>
|
||||
</Choose>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.Uwp.Build.targets" Condition="'$(UseUWP)' == 'true'"/>
|
||||
|
||||
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
|
||||
|
@ -36,4 +23,5 @@
|
|||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
|
@ -42,7 +42,7 @@ namespace Microsoft.Toolkit.HighPerformance.Helpers.Internals
|
|||
}
|
||||
else if (sizeof(TFrom) == 1)
|
||||
{
|
||||
return length / sizeof(TTo);
|
||||
return (int)((uint)length / (uint)sizeof(TTo));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="MSBuild.Sdk.Extras">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>uap10.0.17763</TargetFramework>
|
||||
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
|
||||
<Title>Windows Community Toolkit Devices</Title>
|
||||
<Description>This library enables easier consumption of connectivity Devices/Peripherals and handle its connection to Windows devices. It contains BluetoothLE and Network connectivity helpers.</Description>
|
||||
<PackageTags>UWP Toolkit Windows Devices Bluetooth BluetoothLE BLE Networking</PackageTags>
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.DeveloperTools
|
|||
/// <summary>
|
||||
/// AlignmentGrid is used to display a grid to help aligning controls
|
||||
/// </summary>
|
||||
public class AlignmentGrid : ContentControl
|
||||
public partial class AlignmentGrid : ContentControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the <see cref="LineBrush"/> dependency property.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Microsoft.Toolkit.Uwp.DeveloperTools
|
|||
[TemplatePart(Name = "ControlType", Type = typeof(TextBlock))]
|
||||
[TemplatePart(Name = "ControlAutomationName", Type = typeof(TextBlock))]
|
||||
[TemplatePart(Name = "ControlFirstParentWithName", Type = typeof(TextBlock))]
|
||||
public class FocusTracker : Control
|
||||
public partial class FocusTracker : Control
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="IsActive"/> dependency property.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="MSBuild.Sdk.Extras">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>uap10.0.17763</TargetFramework>
|
||||
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
|
||||
<Title>Windows Community Toolkit Developer Tools</Title>
|
||||
<Description>This library provides XAML user controls and services to help developers build their app. It is part of the Windows Community Toolkit.
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Devices.Input.Preview;
|
||||
using Windows.Foundation;
|
||||
|
@ -298,20 +299,9 @@ namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
|
|||
/// </summary>
|
||||
public bool IsAlwaysActivated { get; set; }
|
||||
|
||||
private static GazePointer _instance = null;
|
||||
private static ThreadLocal<GazePointer> _instance = new ThreadLocal<GazePointer>(() => new GazePointer());
|
||||
|
||||
internal static GazePointer Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new GazePointer();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
internal static GazePointer Instance => _instance.Value;
|
||||
|
||||
internal void AddRoot(int proxyId)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
</Description>
|
||||
<PackageTags>notifications win10 windows 10 tile tiles toast toasts badge xml uwp c# csharp c++</PackageTags>
|
||||
<ExtrasImplicitPlatformPackageIsPrivate Condition=" '$(TargetFramework)' == 'native' ">true</ExtrasImplicitPlatformPackageIsPrivate>
|
||||
<DefaultTargetPlatformMinVersion>10240</DefaultTargetPlatformMinVersion>
|
||||
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
|
|
|
@ -21,6 +21,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Controls
|
|||
public static readonly DependencyProperty TextProperty =
|
||||
DependencyProperty.Register(nameof(Text), typeof(string), typeof(XamlCodeEditor), new PropertyMetadata(string.Empty));
|
||||
|
||||
private ThemeListener _themeListener = new ThemeListener();
|
||||
|
||||
public XamlCodeEditor()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
@ -40,7 +42,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Controls
|
|||
// Highlight Error Line
|
||||
XamlCodeRenderer.Decorations.Add(new IModelDeltaDecoration(
|
||||
range,
|
||||
new IModelDecorationOptions() { IsWholeLine = true, ClassName = _errorStyle, HoverMessage = new string[] { error.Message }.ToMarkdownString() }));
|
||||
new IModelDecorationOptions() { IsWholeLine = true, ClassName = ErrorStyle, HoverMessage = new string[] { error.Message }.ToMarkdownString() }));
|
||||
|
||||
// Show Glyph Icon
|
||||
XamlCodeRenderer.Decorations.Add(new IModelDeltaDecoration(
|
||||
|
@ -121,10 +123,12 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Controls
|
|||
|
||||
public DateTime TimeSampleEditedLast { get; private set; } = DateTime.MinValue;
|
||||
|
||||
private CssLineStyle _errorStyle = new CssLineStyle()
|
||||
private CssLineStyle ErrorStyle
|
||||
{
|
||||
BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6))
|
||||
};
|
||||
get => _themeListener.CurrentTheme.Equals(ApplicationTheme.Light) ?
|
||||
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6)) } :
|
||||
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0x66, 0x00, 0x00)) };
|
||||
}
|
||||
|
||||
private CssGlyphStyle _errorIconStyle = new CssGlyphStyle()
|
||||
{
|
||||
|
|
|
@ -124,9 +124,6 @@
|
|||
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
|
||||
<Version>2.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Text.Json">
|
||||
<Version>4.7.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NotificationsVisualizerLibrary">
|
||||
<Version>1.0.5</Version>
|
||||
</PackageReference>
|
||||
|
@ -569,36 +566,18 @@
|
|||
<Compile Include="SamplePages\TokenizingTextBox\TokenizingTextBoxPage.xaml.cs">
|
||||
<DependentUpon>TokenizingTextBoxPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\CompareStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>CompareStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\IsEqualStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>IsEqualStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\FullScreenModeStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>FullScreenModeStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\IsNullOrEmptyStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>IsNullOrEmptyStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\NetworkConnectionStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>NetworkConnectionStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\IsNotEqualStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>IsNotEqualStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\RegexStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>RegexStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\UserHandPreferenceStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>UserHandPreferenceStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\Triggers\UserInteractionModeStateTriggerPage.xaml.cs">
|
||||
<DependentUpon>UserInteractionModeStateTriggerPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\WrapLayout\WrapLayoutPage.xaml.cs">
|
||||
<DependentUpon>WrapLayoutPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\XamlOnlyPage.xaml.cs">
|
||||
<DependentUpon>XamlOnlyPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Shell.Search.cs" />
|
||||
<Compile Include="Shell.SamplePicker.cs" />
|
||||
<Content Include="SamplePages\ViewportBehavior\ViewportBehaviorXaml.bind" />
|
||||
|
@ -1120,14 +1099,6 @@
|
|||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Content>
|
||||
<Page Include="SamplePages\Triggers\CompareStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\IsEqualStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\FullScreenModeStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -1136,26 +1107,6 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\NetworkConnectionStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\IsNotEqualStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\RegexStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\UserHandPreferenceStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\Triggers\UserInteractionModeStateTriggerPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\UniformGrid\UniformGridPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -1484,6 +1435,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SamplePages\XamlOnlyPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Shell.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
|
|
@ -157,6 +157,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
|
||||
public string ApiCheck { get; set; }
|
||||
|
||||
public bool HasType => !string.IsNullOrWhiteSpace(Type);
|
||||
|
||||
public bool HasXAMLCode => !string.IsNullOrEmpty(XamlCodeFile);
|
||||
|
||||
public bool HasCSharpCode => !string.IsNullOrEmpty(CodeFile);
|
||||
|
|
|
@ -191,7 +191,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
|
||||
if (CurrentSample != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(CurrentSample.Type))
|
||||
if (CurrentSample.HasType)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -219,7 +219,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
SamplePage.Loaded += SamplePage_Loaded;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!CurrentSample.HasXAMLCode)
|
||||
{
|
||||
_onlyDocumentation = true;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
|
||||
if (SamplePage != null)
|
||||
if (SamplePage != null && CurrentSample.HasType)
|
||||
{
|
||||
MethodInfo method = CurrentSample.PageType.GetMethod(
|
||||
"OnNavigatedFrom",
|
||||
|
@ -510,13 +510,13 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
|
||||
if (element != null)
|
||||
{
|
||||
// Add element to main panel
|
||||
if (SamplePage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Add element to main panel or sub-panel
|
||||
FrameworkElement root = null;
|
||||
|
||||
var root = SamplePage.FindDescendantByName("XamlRoot");
|
||||
if (CurrentSample.HasType)
|
||||
{
|
||||
root = SamplePage?.FindDescendantByName("XamlRoot");
|
||||
}
|
||||
|
||||
if (root is Panel)
|
||||
{
|
||||
|
@ -527,7 +527,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
else
|
||||
{
|
||||
// Otherwise, just replace the entire page's content
|
||||
SamplePage.Content = element;
|
||||
SampleContent.Content = element;
|
||||
}
|
||||
|
||||
// Tell the page we've finished with an update to the XAML contents, after the control has rendered.
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Toolkit.Uwp.Helpers;
|
||||
using Microsoft.Toolkit.Uwp.Extensions;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.Toolkit.Uwp.Extensions;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.CompareStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:CompareStateTrigger x:Key="CompareStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,24 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class CompareStateTriggerPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CompareStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public CompareStateTriggerPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.IsEqualStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:IsEqualStateTrigger x:Key="IsEqualStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,24 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class IsEqualStateTriggerPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IsEqualStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public IsEqualStateTriggerPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.IsNotEqualStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:IsNotEqualStateTrigger x:Key="IsNotEqualStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,24 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class IsNotEqualStateTriggerPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IsNotEqualStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public IsNotEqualStateTriggerPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +1,14 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.IsNullOrEmptyStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.IsNullOrEmptyStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:IsNullOrEmptyStateTrigger x:Key="IsNullOrEmptyStateTrigger"/>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:IsNullOrEmptyStateTrigger x:Key="IsNullOrEmptyStateTrigger" />
|
||||
</Page.Resources>
|
||||
</Page>
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.NetworkConnectionStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:NetworkConnectionStateTrigger x:Key="NetworkConnectionStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,24 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class NetworkConnectionStateTriggerPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NetworkConnectionStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public NetworkConnectionStateTriggerPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.RegexStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:RegexStateTrigger x:Key="RegexStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.UserHandPreferenceStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:UserHandPreferenceStateTrigger x:Key="UserHandPreferenceStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,24 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class UserHandPreferenceStateTriggerPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserHandPreferenceStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public UserHandPreferenceStateTriggerPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<Page
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.UserInteractionModeStateTriggerPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Page.Resources>
|
||||
<!-- Dummy Resource for Optimization Protection -->
|
||||
<triggers:UserInteractionModeStateTrigger x:Key="UserInteractionModeStateTrigger"/>
|
||||
</Page.Resources>
|
||||
</Page>
|
|
@ -1,24 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class UserInteractionModeStateTriggerPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserInteractionModeStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public UserInteractionModeStateTriggerPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.XamlOnlyPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<!-- Dummy Page for .NET Native Optimization Protection -->
|
||||
<!-- Put a copy of any controls/resources required for XAML Parsing within XAML Only Samples -->
|
||||
<!-- This page is never loaded by the app, but used to trick the compiler... -->
|
||||
<Page.Resources>
|
||||
<triggers:CompareStateTrigger x:Key="CompareStateTrigger" />
|
||||
<triggers:IsEqualStateTrigger x:Key="IsEqualStateTrigger" />
|
||||
<triggers:IsNotEqualStateTrigger x:Key="IsNotEqualStateTrigger" />
|
||||
<triggers:NetworkConnectionStateTrigger x:Key="NetworkConnectionStateTrigger" />
|
||||
<triggers:RegexStateTrigger x:Key="RegexStateTrigger" />
|
||||
<triggers:UserHandPreferenceStateTrigger x:Key="UserHandPreferenceStateTrigger" />
|
||||
<triggers:UserInteractionModeStateTrigger x:Key="UserInteractionModeStateTrigger" />
|
||||
</Page.Resources>
|
||||
|
||||
<Grid />
|
||||
</Page>
|
|
@ -2,8 +2,6 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
|
@ -11,14 +9,12 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class RegexStateTriggerPage : Page
|
||||
public sealed partial class XamlOnlyPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RegexStateTriggerPage"/> class.
|
||||
/// </summary>
|
||||
public RegexStateTriggerPage()
|
||||
public XamlOnlyPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
// DO NOT add any code here, this page is never loaded...
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -951,7 +951,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "CompareStateTrigger",
|
||||
"Type": "CompareStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Enables a state if the value is equal to, greater than, or less than another value",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
@ -961,7 +960,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "IsEqualStateTrigger",
|
||||
"Type": "IsEqualStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Enables a state if the value is equal to another value",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
@ -991,7 +989,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "NetworkConnectionStateTrigger",
|
||||
"Type": "NetworkConnectionStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Trigger for switching when the network availability changes",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
@ -1001,7 +998,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "IsNotEqualStateTrigger",
|
||||
"Type": "IsNotEqualStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Enables a state if the value is not equal to another value",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
@ -1011,7 +1007,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "RegexStateTrigger",
|
||||
"Type": "RegexStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Enables a state if the regex expression is true for a given string value",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
@ -1021,7 +1016,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "UserHandPreferenceStateTrigger",
|
||||
"Type": "UserHandPreferenceStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Trigger for switching UI based on whether the user favours their left or right hand.",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
@ -1031,7 +1025,6 @@
|
|||
},
|
||||
{
|
||||
"Name": "UserInteractionModeStateTrigger",
|
||||
"Type": "UserInteractionModeStateTriggerPage",
|
||||
"Subcategory": "State Triggers",
|
||||
"About": "Trigger for switching when the User interaction mode changes (tablet mode)",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Toolkit.Uwp.Extensions;
|
||||
using Microsoft.Toolkit.Uwp.Helpers;
|
||||
using Microsoft.Toolkit.Uwp.SampleApp.Pages;
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations;
|
||||
|
@ -147,7 +148,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
ShowSamplePicker(category.Samples, true);
|
||||
|
||||
// Then Focus on Picker
|
||||
DispatcherHelper.ExecuteOnUIThreadAsync(() => SamplePickerGridView.Focus(FocusState.Keyboard));
|
||||
dispatcherQueue.EnqueueAsync(() => SamplePickerGridView.Focus(FocusState.Keyboard));
|
||||
}
|
||||
}
|
||||
else if (args.IsSettingsInvoked)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Linq;
|
||||
using Microsoft.Toolkit.Uwp.Extensions;
|
||||
using Microsoft.Toolkit.Uwp.Helpers;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
|
@ -76,7 +77,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
if (e.Key == Windows.System.VirtualKey.Down && SamplePickerGrid.Visibility == Windows.UI.Xaml.Visibility.Visible)
|
||||
{
|
||||
// If we try and navigate down out of the textbox (and there's search results), go to the search results.
|
||||
DispatcherHelper.ExecuteOnUIThreadAsync(() => SamplePickerGridView.Focus(FocusState.Keyboard));
|
||||
dispatcherQueue.EnqueueAsync(() => SamplePickerGridView.Focus(FocusState.Keyboard));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ using Microsoft.Toolkit.Uwp.Helpers;
|
|||
using Microsoft.Toolkit.Uwp.SampleApp.Pages;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media.Animation;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
@ -16,6 +15,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
{
|
||||
public sealed partial class Shell
|
||||
{
|
||||
private readonly DispatcherQueue dispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
||||
|
||||
public static Shell Current { get; private set; }
|
||||
|
||||
public Shell()
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// Abstract class providing common dependency properties for composition animations
|
||||
/// </summary>
|
||||
[ContentProperty(Name = nameof(KeyFrames))]
|
||||
public abstract class AnimationBase : DependencyObject
|
||||
public abstract partial class AnimationBase : DependencyObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the <see cref="Target"/> property
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// <summary>
|
||||
/// Provides common Dependency properties for KeyFrames
|
||||
/// </summary>
|
||||
public abstract class KeyFrame : DependencyObject
|
||||
public abstract partial class KeyFrame : DependencyObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the <see cref="Key"/> dependency property
|
||||
|
|
|
@ -221,6 +221,26 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations.Expressions
|
|||
modifier.Motion = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use the value of specified ExpressionNode to determine if this composition conditional value modifier should be chosen.
|
||||
/// </summary>
|
||||
/// <param name="modifier">The modifier.</param>
|
||||
/// <param name="expressionNode">The root ExpressionNode that represents the ExpressionAnimation.</param>
|
||||
public static void SetCondition(this CompositionConditionalValue modifier, ExpressionNode expressionNode)
|
||||
{
|
||||
modifier.Condition = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use the value of specified ExpressionNode as the value for this composition conditional value
|
||||
/// </summary>
|
||||
/// <param name="modifier">The modifier.</param>
|
||||
/// <param name="expressionNode">The root ExpressionNode that represents the ExpressionAnimation.</param>
|
||||
public static void SetValue(this CompositionConditionalValue modifier, ExpressionNode expressionNode)
|
||||
{
|
||||
modifier.Value = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the expression animation from node.
|
||||
/// </summary>
|
||||
|
|
|
@ -1253,80 +1253,80 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations.Expressions
|
|||
/// </summary>
|
||||
private static readonly Dictionary<ExpressionNodeType, ExpressionNodeInfo> _expressionNodeInfo = new Dictionary<ExpressionNodeType, ExpressionNodeInfo>
|
||||
{
|
||||
{ ExpressionNodeType.ConstantValue, new ExpressionNodeInfo(OperationType.Constant, null) },
|
||||
{ ExpressionNodeType.ConstantParameter, new ExpressionNodeInfo(OperationType.Constant, null) },
|
||||
{ ExpressionNodeType.CurrentValueProperty, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.Reference, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.ReferenceProperty, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.StartingValueProperty, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.TargetReference, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.Conditional, new ExpressionNodeInfo(OperationType.Conditional, null) },
|
||||
{ ExpressionNodeType.Swizzle, new ExpressionNodeInfo(OperationType.Swizzle, null) },
|
||||
{ ExpressionNodeType.Add, new ExpressionNodeInfo(OperationType.Operator, "+") },
|
||||
{ ExpressionNodeType.And, new ExpressionNodeInfo(OperationType.Operator, "&&") },
|
||||
{ ExpressionNodeType.Divide, new ExpressionNodeInfo(OperationType.Operator, "/") },
|
||||
{ ExpressionNodeType.Equals, new ExpressionNodeInfo(OperationType.Operator, "==") },
|
||||
{ ExpressionNodeType.GreaterThan, new ExpressionNodeInfo(OperationType.Operator, ">") },
|
||||
{ ExpressionNodeType.GreaterThanEquals, new ExpressionNodeInfo(OperationType.Operator, ">=") },
|
||||
{ ExpressionNodeType.LessThan, new ExpressionNodeInfo(OperationType.Operator, "<") },
|
||||
{ ExpressionNodeType.LessThanEquals, new ExpressionNodeInfo(OperationType.Operator, "<=") },
|
||||
{ ExpressionNodeType.Multiply, new ExpressionNodeInfo(OperationType.Operator, "*") },
|
||||
{ ExpressionNodeType.Not, new ExpressionNodeInfo(OperationType.Operator, "!") },
|
||||
{ ExpressionNodeType.NotEquals, new ExpressionNodeInfo(OperationType.Operator, "!=") },
|
||||
{ ExpressionNodeType.Or, new ExpressionNodeInfo(OperationType.Operator, "||") },
|
||||
{ ExpressionNodeType.Subtract, new ExpressionNodeInfo(OperationType.Operator, "-") },
|
||||
{ ExpressionNodeType.Absolute, new ExpressionNodeInfo(OperationType.Function, "abs") },
|
||||
{ ExpressionNodeType.Acos, new ExpressionNodeInfo(OperationType.Function, "acos") },
|
||||
{ ExpressionNodeType.Asin, new ExpressionNodeInfo(OperationType.Function, "asin") },
|
||||
{ ExpressionNodeType.Atan, new ExpressionNodeInfo(OperationType.Function, "atan") },
|
||||
{ ExpressionNodeType.Cos, new ExpressionNodeInfo(OperationType.Function, "cos") },
|
||||
{ ExpressionNodeType.Ceil, new ExpressionNodeInfo(OperationType.Function, "ceil") },
|
||||
{ ExpressionNodeType.Clamp, new ExpressionNodeInfo(OperationType.Function, "clamp") },
|
||||
{ ExpressionNodeType.ColorHsl, new ExpressionNodeInfo(OperationType.Function, "colorhsl") },
|
||||
{ ExpressionNodeType.ColorRgb, new ExpressionNodeInfo(OperationType.Function, "colorrgb") },
|
||||
{ ExpressionNodeType.ColorLerp, new ExpressionNodeInfo(OperationType.Function, "colorlerp") },
|
||||
{ ExpressionNodeType.ColorLerpHsl, new ExpressionNodeInfo(OperationType.Function, "colorhsllerp") },
|
||||
{ ExpressionNodeType.ColorLerpRgb, new ExpressionNodeInfo(OperationType.Function, "colorrgblerp") },
|
||||
{ ExpressionNodeType.Concatenate, new ExpressionNodeInfo(OperationType.Function, "concatenate") },
|
||||
{ ExpressionNodeType.Distance, new ExpressionNodeInfo(OperationType.Function, "distance") },
|
||||
{ ExpressionNodeType.DistanceSquared, new ExpressionNodeInfo(OperationType.Function, "distancesquared") },
|
||||
{ ExpressionNodeType.Floor, new ExpressionNodeInfo(OperationType.Function, "floor") },
|
||||
{ ExpressionNodeType.Inverse, new ExpressionNodeInfo(OperationType.Function, "inverse") },
|
||||
{ ExpressionNodeType.Length, new ExpressionNodeInfo(OperationType.Function, "length") },
|
||||
{ ExpressionNodeType.LengthSquared, new ExpressionNodeInfo(OperationType.Function, "lengthsquared") },
|
||||
{ ExpressionNodeType.Lerp, new ExpressionNodeInfo(OperationType.Function, "lerp") },
|
||||
{ ExpressionNodeType.Ln, new ExpressionNodeInfo(OperationType.Function, "ln") },
|
||||
{ ExpressionNodeType.Log10, new ExpressionNodeInfo(OperationType.Function, "log10") },
|
||||
{ ExpressionNodeType.Max, new ExpressionNodeInfo(OperationType.Function, "max") },
|
||||
{ ExpressionNodeType.Matrix3x2FromRotation, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createrotation") },
|
||||
{ ExpressionNodeType.Matrix3x2FromScale, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createscale") },
|
||||
{ ExpressionNodeType.Matrix3x2FromSkew, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createskew") },
|
||||
{ ExpressionNodeType.Matrix3x2FromTranslation, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createtranslation") },
|
||||
{ ExpressionNodeType.Matrix3x2, new ExpressionNodeInfo(OperationType.Function, "matrix3x2") },
|
||||
{ ExpressionNodeType.Matrix4x4FromAxisAngle, new ExpressionNodeInfo(OperationType.Function, "matrix4x4.createfromaxisangle") },
|
||||
{ ExpressionNodeType.Matrix4x4FromScale, new ExpressionNodeInfo(OperationType.Function, "matrix4x4.createscale") },
|
||||
{ ExpressionNodeType.Matrix4x4FromTranslation, new ExpressionNodeInfo(OperationType.Function, "matrix4x4.createtranslation") },
|
||||
{ ExpressionNodeType.Matrix4x4, new ExpressionNodeInfo(OperationType.Function, "matrix4x4") },
|
||||
{ ExpressionNodeType.Min, new ExpressionNodeInfo(OperationType.Function, "min") },
|
||||
{ ExpressionNodeType.Modulus, new ExpressionNodeInfo(OperationType.Function, "mod") },
|
||||
{ ExpressionNodeType.Negate, new ExpressionNodeInfo(OperationType.Function, "-") },
|
||||
{ ExpressionNodeType.Normalize, new ExpressionNodeInfo(OperationType.Function, "normalize") },
|
||||
{ ExpressionNodeType.Pow, new ExpressionNodeInfo(OperationType.Function, "pow") },
|
||||
{ ExpressionNodeType.QuaternionFromAxisAngle, new ExpressionNodeInfo(OperationType.Function, "quaternion.createfromaxisangle") },
|
||||
{ ExpressionNodeType.Quaternion, new ExpressionNodeInfo(OperationType.Function, "quaternion") },
|
||||
{ ExpressionNodeType.Round, new ExpressionNodeInfo(OperationType.Function, "round") },
|
||||
{ ExpressionNodeType.Scale, new ExpressionNodeInfo(OperationType.Function, "scale") },
|
||||
{ ExpressionNodeType.Sin, new ExpressionNodeInfo(OperationType.Function, "sin") },
|
||||
{ ExpressionNodeType.Slerp, new ExpressionNodeInfo(OperationType.Function, "slerp") },
|
||||
{ ExpressionNodeType.Sqrt, new ExpressionNodeInfo(OperationType.Function, "sqrt") },
|
||||
{ ExpressionNodeType.Square, new ExpressionNodeInfo(OperationType.Function, "square") },
|
||||
{ ExpressionNodeType.Tan, new ExpressionNodeInfo(OperationType.Function, "tan") },
|
||||
{ ExpressionNodeType.ToDegrees, new ExpressionNodeInfo(OperationType.Function, "todegrees") },
|
||||
{ ExpressionNodeType.ToRadians, new ExpressionNodeInfo(OperationType.Function, "toradians") },
|
||||
{ ExpressionNodeType.Transform, new ExpressionNodeInfo(OperationType.Function, "transform") },
|
||||
{ ExpressionNodeType.Vector2, new ExpressionNodeInfo(OperationType.Function, "vector2") },
|
||||
{ ExpressionNodeType.Vector3, new ExpressionNodeInfo(OperationType.Function, "vector3") },
|
||||
{ ExpressionNodeType.Vector4, new ExpressionNodeInfo(OperationType.Function, "vector4") },
|
||||
{ ExpressionNodeType.ConstantValue, new ExpressionNodeInfo(OperationType.Constant, null) },
|
||||
{ ExpressionNodeType.ConstantParameter, new ExpressionNodeInfo(OperationType.Constant, null) },
|
||||
{ ExpressionNodeType.CurrentValueProperty, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.Reference, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.ReferenceProperty, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.StartingValueProperty, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.TargetReference, new ExpressionNodeInfo(OperationType.Reference, null) },
|
||||
{ ExpressionNodeType.Conditional, new ExpressionNodeInfo(OperationType.Conditional, null) },
|
||||
{ ExpressionNodeType.Swizzle, new ExpressionNodeInfo(OperationType.Swizzle, null) },
|
||||
{ ExpressionNodeType.Add, new ExpressionNodeInfo(OperationType.Operator, "+") },
|
||||
{ ExpressionNodeType.And, new ExpressionNodeInfo(OperationType.Operator, "&&") },
|
||||
{ ExpressionNodeType.Divide, new ExpressionNodeInfo(OperationType.Operator, "/") },
|
||||
{ ExpressionNodeType.Equals, new ExpressionNodeInfo(OperationType.Operator, "==") },
|
||||
{ ExpressionNodeType.GreaterThan, new ExpressionNodeInfo(OperationType.Operator, ">") },
|
||||
{ ExpressionNodeType.GreaterThanEquals, new ExpressionNodeInfo(OperationType.Operator, ">=") },
|
||||
{ ExpressionNodeType.LessThan, new ExpressionNodeInfo(OperationType.Operator, "<") },
|
||||
{ ExpressionNodeType.LessThanEquals, new ExpressionNodeInfo(OperationType.Operator, "<=") },
|
||||
{ ExpressionNodeType.Multiply, new ExpressionNodeInfo(OperationType.Operator, "*") },
|
||||
{ ExpressionNodeType.Not, new ExpressionNodeInfo(OperationType.UnaryOperator, "!") },
|
||||
{ ExpressionNodeType.NotEquals, new ExpressionNodeInfo(OperationType.Operator, "!=") },
|
||||
{ ExpressionNodeType.Or, new ExpressionNodeInfo(OperationType.Operator, "||") },
|
||||
{ ExpressionNodeType.Subtract, new ExpressionNodeInfo(OperationType.Operator, "-") },
|
||||
{ ExpressionNodeType.Absolute, new ExpressionNodeInfo(OperationType.Function, "abs") },
|
||||
{ ExpressionNodeType.Acos, new ExpressionNodeInfo(OperationType.Function, "acos") },
|
||||
{ ExpressionNodeType.Asin, new ExpressionNodeInfo(OperationType.Function, "asin") },
|
||||
{ ExpressionNodeType.Atan, new ExpressionNodeInfo(OperationType.Function, "atan") },
|
||||
{ ExpressionNodeType.Cos, new ExpressionNodeInfo(OperationType.Function, "cos") },
|
||||
{ ExpressionNodeType.Ceil, new ExpressionNodeInfo(OperationType.Function, "ceil") },
|
||||
{ ExpressionNodeType.Clamp, new ExpressionNodeInfo(OperationType.Function, "clamp") },
|
||||
{ ExpressionNodeType.ColorHsl, new ExpressionNodeInfo(OperationType.Function, "colorhsl") },
|
||||
{ ExpressionNodeType.ColorRgb, new ExpressionNodeInfo(OperationType.Function, "colorrgb") },
|
||||
{ ExpressionNodeType.ColorLerp, new ExpressionNodeInfo(OperationType.Function, "colorlerp") },
|
||||
{ ExpressionNodeType.ColorLerpHsl, new ExpressionNodeInfo(OperationType.Function, "colorhsllerp") },
|
||||
{ ExpressionNodeType.ColorLerpRgb, new ExpressionNodeInfo(OperationType.Function, "colorrgblerp") },
|
||||
{ ExpressionNodeType.Concatenate, new ExpressionNodeInfo(OperationType.Function, "concatenate") },
|
||||
{ ExpressionNodeType.Distance, new ExpressionNodeInfo(OperationType.Function, "distance") },
|
||||
{ ExpressionNodeType.DistanceSquared, new ExpressionNodeInfo(OperationType.Function, "distancesquared") },
|
||||
{ ExpressionNodeType.Floor, new ExpressionNodeInfo(OperationType.Function, "floor") },
|
||||
{ ExpressionNodeType.Inverse, new ExpressionNodeInfo(OperationType.Function, "inverse") },
|
||||
{ ExpressionNodeType.Length, new ExpressionNodeInfo(OperationType.Function, "length") },
|
||||
{ ExpressionNodeType.LengthSquared, new ExpressionNodeInfo(OperationType.Function, "lengthsquared") },
|
||||
{ ExpressionNodeType.Lerp, new ExpressionNodeInfo(OperationType.Function, "lerp") },
|
||||
{ ExpressionNodeType.Ln, new ExpressionNodeInfo(OperationType.Function, "ln") },
|
||||
{ ExpressionNodeType.Log10, new ExpressionNodeInfo(OperationType.Function, "log10") },
|
||||
{ ExpressionNodeType.Max, new ExpressionNodeInfo(OperationType.Function, "max") },
|
||||
{ ExpressionNodeType.Matrix3x2FromRotation, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createrotation") },
|
||||
{ ExpressionNodeType.Matrix3x2FromScale, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createscale") },
|
||||
{ ExpressionNodeType.Matrix3x2FromSkew, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createskew") },
|
||||
{ ExpressionNodeType.Matrix3x2FromTranslation, new ExpressionNodeInfo(OperationType.Function, "matrix3x2.createtranslation") },
|
||||
{ ExpressionNodeType.Matrix3x2, new ExpressionNodeInfo(OperationType.Function, "matrix3x2") },
|
||||
{ ExpressionNodeType.Matrix4x4FromAxisAngle, new ExpressionNodeInfo(OperationType.Function, "matrix4x4.createfromaxisangle") },
|
||||
{ ExpressionNodeType.Matrix4x4FromScale, new ExpressionNodeInfo(OperationType.Function, "matrix4x4.createscale") },
|
||||
{ ExpressionNodeType.Matrix4x4FromTranslation, new ExpressionNodeInfo(OperationType.Function, "matrix4x4.createtranslation") },
|
||||
{ ExpressionNodeType.Matrix4x4, new ExpressionNodeInfo(OperationType.Function, "matrix4x4") },
|
||||
{ ExpressionNodeType.Min, new ExpressionNodeInfo(OperationType.Function, "min") },
|
||||
{ ExpressionNodeType.Modulus, new ExpressionNodeInfo(OperationType.Function, "mod") },
|
||||
{ ExpressionNodeType.Negate, new ExpressionNodeInfo(OperationType.Function, "-") },
|
||||
{ ExpressionNodeType.Normalize, new ExpressionNodeInfo(OperationType.Function, "normalize") },
|
||||
{ ExpressionNodeType.Pow, new ExpressionNodeInfo(OperationType.Function, "pow") },
|
||||
{ ExpressionNodeType.QuaternionFromAxisAngle, new ExpressionNodeInfo(OperationType.Function, "quaternion.createfromaxisangle") },
|
||||
{ ExpressionNodeType.Quaternion, new ExpressionNodeInfo(OperationType.Function, "quaternion") },
|
||||
{ ExpressionNodeType.Round, new ExpressionNodeInfo(OperationType.Function, "round") },
|
||||
{ ExpressionNodeType.Scale, new ExpressionNodeInfo(OperationType.Function, "scale") },
|
||||
{ ExpressionNodeType.Sin, new ExpressionNodeInfo(OperationType.Function, "sin") },
|
||||
{ ExpressionNodeType.Slerp, new ExpressionNodeInfo(OperationType.Function, "slerp") },
|
||||
{ ExpressionNodeType.Sqrt, new ExpressionNodeInfo(OperationType.Function, "sqrt") },
|
||||
{ ExpressionNodeType.Square, new ExpressionNodeInfo(OperationType.Function, "square") },
|
||||
{ ExpressionNodeType.Tan, new ExpressionNodeInfo(OperationType.Function, "tan") },
|
||||
{ ExpressionNodeType.ToDegrees, new ExpressionNodeInfo(OperationType.Function, "todegrees") },
|
||||
{ ExpressionNodeType.ToRadians, new ExpressionNodeInfo(OperationType.Function, "toradians") },
|
||||
{ ExpressionNodeType.Transform, new ExpressionNodeInfo(OperationType.Function, "transform") },
|
||||
{ ExpressionNodeType.Vector2, new ExpressionNodeInfo(OperationType.Function, "vector2") },
|
||||
{ ExpressionNodeType.Vector3, new ExpressionNodeInfo(OperationType.Function, "vector3") },
|
||||
{ ExpressionNodeType.Vector4, new ExpressionNodeInfo(OperationType.Function, "vector4") },
|
||||
};
|
||||
}
|
||||
}
|
|
@ -502,6 +502,15 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations.Expressions
|
|||
ret = $"({Children[0].ToExpressionStringInternal()} {GetOperationString()} {Children[1].ToExpressionStringInternal()})";
|
||||
break;
|
||||
|
||||
case OperationType.UnaryOperator:
|
||||
if (Children.Count != 1)
|
||||
{
|
||||
throw new Exception("Can't have an unary operator that doesn't have exactly one params");
|
||||
}
|
||||
|
||||
ret = $"( {GetOperationString()} {Children[0].ToExpressionStringInternal()} )";
|
||||
break;
|
||||
|
||||
case OperationType.Constant:
|
||||
if (Children.Count == 0)
|
||||
{
|
||||
|
|
|
@ -15,10 +15,15 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations.Expressions
|
|||
Function,
|
||||
|
||||
/// <summary>
|
||||
/// The operator
|
||||
/// The operator (takes two operands)
|
||||
/// </summary>
|
||||
Operator,
|
||||
|
||||
/// <summary>
|
||||
/// The operator that only takes one operand
|
||||
/// </summary>
|
||||
UnaryOperator,
|
||||
|
||||
/// <summary>
|
||||
/// The constant
|
||||
/// </summary>
|
||||
|
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using Microsoft.Graphics.Canvas;
|
||||
using Microsoft.Graphics.Canvas.Effects;
|
||||
using Microsoft.Toolkit.Uwp.Helpers;
|
||||
using Microsoft.Toolkit.Uwp.Extensions;
|
||||
using Windows.UI;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Composition.Effects;
|
||||
|
@ -102,7 +102,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
var task = new AnimationTask();
|
||||
task.AnimationSet = animationSet;
|
||||
|
||||
task.Task = DispatcherHelper.ExecuteOnUIThreadAsync(
|
||||
task.Task = visual.DispatcherQueue.EnqueueAsync(
|
||||
() =>
|
||||
{
|
||||
const string sceneName = "PointLightScene";
|
||||
|
@ -184,7 +184,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
}
|
||||
|
||||
pointLights[visual] = pointLight;
|
||||
}, Windows.UI.Core.CoreDispatcherPriority.Normal);
|
||||
});
|
||||
|
||||
animationSet.AddAnimationThroughTask(task);
|
||||
return animationSet;
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// <summary>
|
||||
/// Internal tool to link composite transforms to elements
|
||||
/// </summary>
|
||||
internal class AnimationTools : DependencyObject
|
||||
internal partial class AnimationTools : DependencyObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Attached property used to link composite transform with UIElement
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="MSBuild.Sdk.Extras">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>uap10.0.17763</TargetFramework>
|
||||
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
|
||||
<Title>Windows Community Toolkit Animations</Title>
|
||||
<Description>
|
||||
This library provides helpers and extensions on top of Windows Composition and XAML storyboards. It is part of the Windows Community Toolkit.
|
||||
|
|
|
@ -1,253 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.Design.Common
|
||||
{
|
||||
public class MetadataRegistrationBase
|
||||
{
|
||||
private AttributeTable masterMetadataTable;
|
||||
|
||||
internal MetadataRegistrationBase() { }
|
||||
|
||||
/// <summary>
|
||||
/// Build design time metadata attribute table.
|
||||
/// </summary>
|
||||
/// <returns>Custom attribute table.</returns>
|
||||
protected virtual AttributeTable BuildAttributeTable()
|
||||
{
|
||||
AttributeTableBuilder builder = new AttributeTableBuilder();
|
||||
|
||||
AddDescriptions(builder);
|
||||
AddAttributes(builder);
|
||||
AddTables(builder, this);
|
||||
masterMetadataTable = builder.CreateTable();
|
||||
return masterMetadataTable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find all AttributeTableBuilder subclasses in the assembly
|
||||
/// and add their attributes to the assembly attribute table.
|
||||
/// </summary>
|
||||
/// <param name="builder">The assembly attribute table builder.</param>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Design time dll should not fail!")]
|
||||
private void AddTables(AttributeTableBuilder builder, object parent)
|
||||
{
|
||||
Debug.Assert(builder != null, "AddTables is called with null parameter!");
|
||||
|
||||
Assembly asm = parent.GetType().Assembly;
|
||||
foreach (Type t in asm.GetTypes())
|
||||
{
|
||||
if (t.IsSubclassOf(typeof(AttributeTableBuilder)))
|
||||
{
|
||||
try
|
||||
{
|
||||
AttributeTableBuilder atb = (AttributeTableBuilder)Activator.CreateInstance(t);
|
||||
builder.AddTable(atb.CreateTable());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//error loading design assembly
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the case sensitive resource name of the embedded XML file.
|
||||
/// </summary>
|
||||
protected string XmlResourceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the FullName of the corresponding run time assembly.
|
||||
/// </summary>
|
||||
protected string AssemblyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create description attribute from run time assembly xml file.
|
||||
/// </summary>
|
||||
/// <param name="builder">The assembly attribute table builder.</param>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Design time dll should not fail.")]
|
||||
private void AddDescriptions(AttributeTableBuilder builder)
|
||||
{
|
||||
Debug.Assert(builder != null, "AddDescriptions is called with null parameter!");
|
||||
|
||||
if (string.IsNullOrEmpty(XmlResourceName) ||
|
||||
string.IsNullOrEmpty(AssemblyFullName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
XDocument xdoc = null;
|
||||
try
|
||||
{
|
||||
xdoc = XDocument.Load(new StreamReader(
|
||||
Assembly.GetExecutingAssembly().GetManifestResourceStream(XmlResourceName)));
|
||||
}
|
||||
catch { return; }
|
||||
if (xdoc == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (XElement member in xdoc.Descendants("member"))
|
||||
{
|
||||
try
|
||||
{
|
||||
string name = (string)member.Attribute("name");
|
||||
if (name == null)
|
||||
continue;
|
||||
bool isType = name.StartsWith("T:", StringComparison.OrdinalIgnoreCase);
|
||||
if (isType ||
|
||||
name.StartsWith("P:", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
int lastDot = name.Length;
|
||||
string typeName;
|
||||
if (isType)
|
||||
{
|
||||
typeName = name.Substring(2); // skip leading "T:"
|
||||
}
|
||||
else
|
||||
{
|
||||
lastDot = name.LastIndexOf('.');
|
||||
typeName = name.Substring(2, lastDot - 2);
|
||||
}
|
||||
typeName += AssemblyFullName;
|
||||
|
||||
Type t = Type.GetType(typeName);
|
||||
if (t != null && t.IsPublic && t.IsClass &&
|
||||
t.IsSubclassOf(Types.PlatformTypes.DependencyObjectType))
|
||||
{
|
||||
string desc = ParseDescription(member);
|
||||
if (desc == null)
|
||||
continue;
|
||||
|
||||
desc = desc.Trim();
|
||||
desc = string.Join(" ", desc.Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries));
|
||||
if (isType)
|
||||
{
|
||||
bool isBrowsable = true;
|
||||
try
|
||||
{
|
||||
isBrowsable = IsBrowsable(t);
|
||||
}
|
||||
catch { isBrowsable = false; }
|
||||
if (isBrowsable)
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(new DescriptionAttribute(desc)));
|
||||
else //Hide from intellisense
|
||||
{
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(
|
||||
new BrowsableAttribute(false),
|
||||
new Windows.Design.ToolboxBrowsableAttribute(false),
|
||||
new ToolboxItemAttribute(false)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string propName = name.Substring(lastDot + 1);
|
||||
PropertyInfo pi = t.GetProperty(propName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
|
||||
if (pi != null)
|
||||
{
|
||||
bool isBrowsable = true;
|
||||
try
|
||||
{
|
||||
isBrowsable = IsBrowsable(pi);
|
||||
}
|
||||
catch { isBrowsable = false; }
|
||||
if (isBrowsable)
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(propName, new DescriptionAttribute(desc)));
|
||||
else //Hide from intellisense
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(new BrowsableAttribute(false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsBrowsable(Type t)
|
||||
{
|
||||
var attrs = t.GetCustomAttributes(Types.PlatformTypes.EditorBrowsableAttributeType, false);
|
||||
foreach (var attr in attrs)
|
||||
{
|
||||
return Types.PlatformTypes.IsBrowsable(attr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool IsBrowsable(PropertyInfo pi)
|
||||
{
|
||||
var attrs = pi.GetCustomAttributes(Types.PlatformTypes.EditorBrowsableAttributeType, false);
|
||||
foreach (var attr in attrs)
|
||||
{
|
||||
return Types.PlatformTypes.IsBrowsable(attr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create description string from xml doc summary tag.
|
||||
/// </summary>
|
||||
/// <param name="member">A single node of the xml doc.</param>
|
||||
/// <returns>Description string.</returns>
|
||||
private static string ParseDescription(XElement member)
|
||||
{
|
||||
string desc = null;
|
||||
XElement memberDesc = member.Descendants("summary").FirstOrDefault();
|
||||
|
||||
if (memberDesc != null)
|
||||
{
|
||||
IEnumerable<XNode> nodes = memberDesc.DescendantNodes();
|
||||
|
||||
if (nodes != null)
|
||||
{
|
||||
foreach (XNode node in nodes)
|
||||
{
|
||||
if (node.NodeType == System.Xml.XmlNodeType.Text)
|
||||
{
|
||||
desc += node.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
string s = node.ToString();
|
||||
int i = s.LastIndexOf('.');
|
||||
int j = s.LastIndexOf('"');
|
||||
|
||||
if ((i != -1 || j != -1) && j - i - 1 > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
desc += s.Substring(i + 1, j - i - 1);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provide a place to add custom attributes without creating a AttributeTableBuilder subclass.
|
||||
/// </summary>
|
||||
/// <param name="builder">The assembly attribute table builder.</param>
|
||||
protected virtual void AddAttributes(AttributeTableBuilder builder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.Design.Types
|
||||
{
|
||||
internal class PlatformTypes
|
||||
{
|
||||
public static readonly Type DependencyObjectType = typeof(DependencyObject);
|
||||
public static readonly Type UIElementType = typeof(UIElement);
|
||||
public static readonly Type FrameworkElementType = typeof(FrameworkElement);
|
||||
public static readonly Type EditorBrowsableAttributeType = typeof(System.ComponentModel.EditorBrowsableAttribute);
|
||||
|
||||
/// <summary>
|
||||
/// Used by MetadataRegistrationBase to get the browsable state
|
||||
/// </summary>
|
||||
/// <param name="editorBrowsableAttribute">This parameter must be of type 'System.ComponentModel.EditorBrowsableAttribute'</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsBrowsable(object editorBrowsableAttribute)
|
||||
{
|
||||
if (editorBrowsableAttribute is System.ComponentModel.EditorBrowsableAttribute)
|
||||
return (editorBrowsableAttribute as System.ComponentModel.EditorBrowsableAttribute).State !=
|
||||
System.ComponentModel.EditorBrowsableState.Never;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class Control
|
||||
{
|
||||
public static readonly TypeIdentifier TypeId = new TypeIdentifier("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Control");
|
||||
public static readonly PropertyIdentifier BackgroundProperty = new PropertyIdentifier(TypeId, "Background");
|
||||
public static readonly PropertyIdentifier BorderBrushProperty = new PropertyIdentifier(TypeId, "BorderBrush");
|
||||
public static readonly PropertyIdentifier BorderThicknessProperty = new PropertyIdentifier(TypeId, "BorderThickness");
|
||||
}
|
||||
|
||||
public static class FrameworkElement
|
||||
{
|
||||
public static readonly TypeIdentifier TypeId = new TypeIdentifier("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "FrameworkElement");
|
||||
public static readonly PropertyIdentifier MarginProperty = new PropertyIdentifier(TypeId, "Margin");
|
||||
public static readonly PropertyIdentifier HorizontalAlignmentProperty = new PropertyIdentifier(TypeId, "HorizontalAlignment");
|
||||
public static readonly PropertyIdentifier VerticalAlignmentProperty = new PropertyIdentifier(TypeId, "VerticalAlignment");
|
||||
public static readonly PropertyIdentifier HeightProperty = new PropertyIdentifier(TypeId, "Height");
|
||||
public static readonly PropertyIdentifier WidthProperty = new PropertyIdentifier(TypeId, "Width");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.ComponentModel;
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Features;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Model;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class DataGridDefaults : DefaultInitializer
|
||||
{
|
||||
public override void InitializeDefaults(ModelItem item)
|
||||
{
|
||||
item.Properties[nameof(DataGrid.Height)].SetValue(50d);
|
||||
item.Properties[nameof(DataGrid.Width)].SetValue(100d);
|
||||
}
|
||||
}
|
||||
|
||||
internal class DataGridMetadata : AttributeTableBuilder
|
||||
{
|
||||
public DataGridMetadata() : base()
|
||||
{
|
||||
AddCallback(ControlTypes.DataGrid,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(new FeatureAttribute(typeof(DataGridDefaults)));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AlternatingRowBackground), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AreRowDetailsFrozen), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AreRowGroupHeadersFrozen), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AutoGenerateColumns), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CanUserReorderColumns), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CanUserResizeColumns), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CanUserSortColumns), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CellStyle), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ClipboardCopyMode), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ColumnHeaderHeight), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ColumnHeaderStyle), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.Columns), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ColumnWidth), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CurrentColumn), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.DragIndicatorStyle), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.DropLocationIndicatorStyle), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.FrozenColumnCount), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.GridLinesVisibility), new CategoryAttribute(Resources.CategoryGridLines));
|
||||
b.AddCustomAttributes(nameof(DataGrid.HeadersVisibility), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.HorizontalGridLinesBrush), new CategoryAttribute(Resources.CategoryGridLines));
|
||||
b.AddCustomAttributes(nameof(DataGrid.HorizontalScrollBarVisibility), new CategoryAttribute(Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGrid.IsReadOnly), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.IsValid), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ItemsSource), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.MaxColumnWidth), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.MinColumnWidth), new CategoryAttribute(Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowBackground), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowDetailsTemplate), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowDetailsVisibilityMode), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowGroupHeaderPropertyNameAlternative), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowGroupHeaderStyles), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowHeaderStyle), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowHeaderWidth), new CategoryAttribute(Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowHeight), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowStyle), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectedIndex), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectedItem), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectedItems), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectionMode), new CategoryAttribute(Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.VerticalGridLinesBrush), new CategoryAttribute(Resources.CategoryGridLines));
|
||||
b.AddCustomAttributes(nameof(DataGrid.VerticalScrollBarVisibility), new CategoryAttribute(Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
});
|
||||
|
||||
AddCallback(ControlTypes.DataGridColumn,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.CanUserResize), new CategoryAttribute(Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.CanUserSort), new CategoryAttribute(Resources.CategorySort));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.Header), new CategoryAttribute(Resources.CategoryHeader));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.HeaderStyle), new CategoryAttribute(Resources.CategoryHeader));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.MaxWidth), new CategoryAttribute(Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.MinWidth), new CategoryAttribute(Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.SortDirection), new CategoryAttribute(Resources.CategorySort));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.Visibility), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.Width), new CategoryAttribute(Resources.CategoryLayout));
|
||||
});
|
||||
|
||||
AddCallback(ControlTypes.DataGridBoundColumn,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridBoundColumn.Binding), new CategoryAttribute(Resources.CategoryCellBinding));
|
||||
});
|
||||
|
||||
AddCallback(ControlTypes.DataGridTextColumn,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontFamily), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontSize), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontStyle), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontWeight), new CategoryAttribute(Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.Foreground), new CategoryAttribute(Resources.CategoryText));
|
||||
});
|
||||
|
||||
AddCallback(ControlTypes.DataGridCheckBoxColumn,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridCheckBoxColumn.IsThreeState), new CategoryAttribute(Resources.CategoryCommon));
|
||||
});
|
||||
|
||||
AddCallback(ControlTypes.DataGridTemplateColumn,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridTemplateColumn.CellEditingTemplate), new CategoryAttribute(Resources.CategoryCellTemplate));
|
||||
b.AddCustomAttributes(nameof(DataGridTemplateColumn.CellTemplate), new CategoryAttribute(Resources.CategoryCellTemplate));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string DataGrid = RootNamespace + "." + nameof(DataGrid);
|
||||
internal const string DataGridColumn = RootNamespace + "." + nameof(DataGridColumn);
|
||||
internal const string DataGridBoundColumn = RootNamespace + "." + nameof(DataGridBoundColumn);
|
||||
internal const string DataGridTextColumn = RootNamespace + "." + nameof(DataGridTextColumn);
|
||||
internal const string DataGridCheckBoxColumn = RootNamespace + "." + nameof(DataGridCheckBoxColumn);
|
||||
internal const string DataGridTemplateColumn = RootNamespace + "." + nameof(DataGridTemplateColumn);
|
||||
}
|
||||
|
||||
internal static class DataGrid
|
||||
{
|
||||
internal const string AlternatingRowBackground = nameof(AlternatingRowBackground);
|
||||
internal const string AreRowDetailsFrozen = nameof(AreRowDetailsFrozen);
|
||||
internal const string AreRowGroupHeadersFrozen = nameof(AreRowGroupHeadersFrozen);
|
||||
internal const string AutoGenerateColumns = nameof(AutoGenerateColumns);
|
||||
internal const string CanUserReorderColumns = nameof(CanUserReorderColumns);
|
||||
internal const string CanUserResizeColumns = nameof(CanUserResizeColumns);
|
||||
internal const string CanUserSortColumns = nameof(CanUserSortColumns);
|
||||
internal const string CellStyle = nameof(CellStyle);
|
||||
internal const string ClipboardCopyMode = nameof(ClipboardCopyMode);
|
||||
internal const string ColumnHeaderHeight = nameof(ColumnHeaderHeight);
|
||||
internal const string ColumnHeaderStyle = nameof(ColumnHeaderStyle);
|
||||
internal const string Columns = nameof(Columns);
|
||||
internal const string ColumnWidth = nameof(ColumnWidth);
|
||||
internal const string CurrentColumn = nameof(CurrentColumn);
|
||||
internal const string DragIndicatorStyle = nameof(DragIndicatorStyle);
|
||||
internal const string DropLocationIndicatorStyle = nameof(DropLocationIndicatorStyle);
|
||||
internal const string FrozenColumnCount = nameof(FrozenColumnCount);
|
||||
internal const string GridLinesVisibility = nameof(GridLinesVisibility);
|
||||
internal const string HeadersVisibility = nameof(HeadersVisibility);
|
||||
internal const string Height = nameof(Height);
|
||||
internal const string HorizontalGridLinesBrush = nameof(HorizontalGridLinesBrush);
|
||||
internal const string HorizontalScrollBarVisibility = nameof(HorizontalScrollBarVisibility);
|
||||
internal const string IsReadOnly = nameof(IsReadOnly);
|
||||
internal const string IsValid = nameof(IsValid);
|
||||
internal const string ItemsSource = nameof(ItemsSource);
|
||||
internal const string MaxColumnWidth = nameof(MaxColumnWidth);
|
||||
internal const string MinColumnWidth = nameof(MinColumnWidth);
|
||||
internal const string RowBackground = nameof(RowBackground);
|
||||
internal const string RowDetailsTemplate = nameof(RowDetailsTemplate);
|
||||
internal const string RowDetailsVisibilityMode = nameof(RowDetailsVisibilityMode);
|
||||
internal const string RowGroupHeaderPropertyNameAlternative = nameof(RowGroupHeaderPropertyNameAlternative);
|
||||
internal const string RowGroupHeaderStyles = nameof(RowGroupHeaderStyles);
|
||||
internal const string RowHeaderStyle = nameof(RowHeaderStyle);
|
||||
internal const string RowHeaderWidth = nameof(RowHeaderWidth);
|
||||
internal const string RowHeight = nameof(RowHeight);
|
||||
internal const string RowStyle = nameof(RowStyle);
|
||||
internal const string SelectedIndex = nameof(SelectedIndex);
|
||||
internal const string SelectedItem = nameof(SelectedItem);
|
||||
internal const string SelectedItems = nameof(SelectedItems);
|
||||
internal const string SelectionMode = nameof(SelectionMode);
|
||||
internal const string VerticalGridLinesBrush = nameof(VerticalGridLinesBrush);
|
||||
internal const string VerticalScrollBarVisibility = nameof(VerticalScrollBarVisibility);
|
||||
internal const string Width = nameof(Width);
|
||||
}
|
||||
|
||||
internal static class DataGridColumn
|
||||
{
|
||||
internal const string CanUserResize = nameof(CanUserResize);
|
||||
internal const string CanUserSort = nameof(CanUserSort);
|
||||
internal const string Header = nameof(Header);
|
||||
internal const string HeaderStyle = nameof(HeaderStyle);
|
||||
internal const string MaxWidth = nameof(MaxWidth);
|
||||
internal const string MinWidth = nameof(MinWidth);
|
||||
internal const string SortDirection = nameof(SortDirection);
|
||||
internal const string Visibility = nameof(Visibility);
|
||||
internal const string Width = nameof(Width);
|
||||
}
|
||||
|
||||
internal static class DataGridBoundColumn
|
||||
{
|
||||
internal const string Binding = nameof(Binding);
|
||||
}
|
||||
|
||||
internal static class DataGridTextColumn
|
||||
{
|
||||
internal const string FontFamily = nameof(FontFamily);
|
||||
internal const string FontSize = nameof(FontSize);
|
||||
internal const string FontStyle = nameof(FontStyle);
|
||||
internal const string FontWeight = nameof(FontWeight);
|
||||
internal const string Foreground = nameof(Foreground);
|
||||
}
|
||||
|
||||
internal static class DataGridCheckBoxColumn
|
||||
{
|
||||
internal const string IsThreeState = nameof(IsThreeState);
|
||||
}
|
||||
|
||||
internal static class DataGridTemplateColumn
|
||||
{
|
||||
internal const string CellEditingTemplate = nameof(CellEditingTemplate);
|
||||
internal const string CellTemplate = nameof(CellTemplate);
|
||||
}
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
//using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
//using Microsoft.Windows.Design.Model;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
//internal class DataGridDefaults : DefaultInitializer
|
||||
//{
|
||||
// public override void InitializeDefaults(ModelItem item)
|
||||
// {
|
||||
// item.Properties[nameof(DataGrid.MyProperty)].SetValue(<value other than runtime default>);
|
||||
// }
|
||||
//}
|
||||
|
||||
internal class DataGridMetadata : AttributeTableBuilder
|
||||
{
|
||||
public DataGridMetadata() : base()
|
||||
{
|
||||
AddCallback(typeof(DataGrid),
|
||||
b =>
|
||||
{
|
||||
//b.AddCustomAttributes(new FeatureAttribute(typeof(DataGridDefaults)));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AlternatingRowBackground), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AreRowDetailsFrozen), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AreRowGroupHeadersFrozen), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.AutoGenerateColumns), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CanUserReorderColumns), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CanUserResizeColumns), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CanUserSortColumns), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CellStyle), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ClipboardCopyMode), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ColumnHeaderHeight), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ColumnHeaderStyle), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.Columns), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ColumnWidth), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.CurrentColumn), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.DragIndicatorStyle), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.DropLocationIndicatorStyle), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.FrozenColumnCount), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.GridLinesVisibility), new CategoryAttribute(Properties.Resources.CategoryGridLines));
|
||||
b.AddCustomAttributes(nameof(DataGrid.HeadersVisibility), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.HorizontalGridLinesBrush), new CategoryAttribute(Properties.Resources.CategoryGridLines));
|
||||
b.AddCustomAttributes(nameof(DataGrid.HorizontalScrollBarVisibility), new CategoryAttribute(Properties.Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGrid.IsReadOnly), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.IsValid), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGrid.ItemsSource), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.MaxColumnWidth), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.MinColumnWidth), new CategoryAttribute(Properties.Resources.CategoryColumns));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowBackground), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowDetailsTemplate), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowDetailsVisibilityMode), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowGroupHeaderPropertyNameAlternative), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowGroupHeaderStyles), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowHeaderStyle), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowHeaderWidth), new CategoryAttribute(Properties.Resources.CategoryHeaders));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowHeight), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.RowStyle), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectedIndex), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectedItem), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectedItems), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(DataGrid.SelectionMode), new CategoryAttribute(Properties.Resources.CategoryRows));
|
||||
b.AddCustomAttributes(nameof(DataGrid.VerticalGridLinesBrush), new CategoryAttribute(Properties.Resources.CategoryGridLines));
|
||||
b.AddCustomAttributes(nameof(DataGrid.VerticalScrollBarVisibility), new CategoryAttribute(Properties.Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
});
|
||||
|
||||
AddCallback(typeof(DataGridColumn),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.CanUserResize), new CategoryAttribute(Properties.Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.CanUserSort), new CategoryAttribute(Properties.Resources.CategorySort));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.Header), new CategoryAttribute(Properties.Resources.CategoryHeader));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.HeaderStyle), new CategoryAttribute(Properties.Resources.CategoryHeader));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.MaxWidth), new CategoryAttribute(Properties.Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.MinWidth), new CategoryAttribute(Properties.Resources.CategoryLayout));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.SortDirection), new CategoryAttribute(Properties.Resources.CategorySort));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.Visibility), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(DataGridColumn.Width), new CategoryAttribute(Properties.Resources.CategoryLayout));
|
||||
});
|
||||
|
||||
AddCallback(typeof(DataGridBoundColumn),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridBoundColumn.Binding), new CategoryAttribute(Properties.Resources.CategoryCellBinding));
|
||||
});
|
||||
|
||||
AddCallback(typeof(DataGridTextColumn),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontFamily), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontSize), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontStyle), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.FontWeight), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
b.AddCustomAttributes(nameof(DataGridTextColumn.Foreground), new CategoryAttribute(Properties.Resources.CategoryText));
|
||||
});
|
||||
|
||||
AddCallback(typeof(DataGridCheckBoxColumn),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridCheckBoxColumn.IsThreeState), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
});
|
||||
|
||||
AddCallback(typeof(DataGridTemplateColumn),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(DataGridTemplateColumn.CellEditingTemplate), new CategoryAttribute(Properties.Resources.CategoryCellTemplate));
|
||||
b.AddCustomAttributes(nameof(DataGridTemplateColumn.CellTemplate), new CategoryAttribute(Properties.Resources.CategoryCellTemplate));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Toolkit.Uwp.Design.Common;
|
||||
|
||||
[assembly: ProvideMetadata(typeof(Microsoft.Toolkit.Uwp.UI.Controls.Design.MetadataRegistration))]
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
public class MetadataRegistration : MetadataRegistrationBase, IProvideAttributeTable
|
||||
{
|
||||
public MetadataRegistration() : base()
|
||||
{
|
||||
// Note:
|
||||
// The default constructor sets value of AssemblyFullName and
|
||||
// XmlResourceName used by MetadataRegistrationBase.AddDescriptions().
|
||||
// The convention here is that the <RootNamespace> in .design.csproj
|
||||
// (or Default namespace in Project -> Properties -> Application tab)
|
||||
// must be the same as runtime assembly's main namespace (t.Namespace)
|
||||
// plus .Design.
|
||||
Type t = typeof(Microsoft.Toolkit.Uwp.UI.Controls.DataGrid);
|
||||
AssemblyName an = t.Assembly.GetName();
|
||||
AssemblyFullName = ", " + an.FullName;
|
||||
XmlResourceName = t.Namespace + ".Design." + an.Name + ".xml";
|
||||
}
|
||||
|
||||
#region IProvideAttributeTable Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the AttributeTable for design time metadata.
|
||||
/// </summary>
|
||||
public AttributeTable AttributeTable
|
||||
{
|
||||
get
|
||||
{
|
||||
return BuildAttributeTable();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -8,21 +8,18 @@
|
|||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Design</RootNamespace>
|
||||
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.Design</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.DesignTools</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.17763</AssetTargetFallback>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetPlatformVersion>8.1</TargetPlatformVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\bin\Debug\uap10.0.17763\Design\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
|
@ -33,18 +30,18 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
|
||||
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.17763</AssetTargetFallback>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.ObjectModel" />
|
||||
<Reference Include="System.Runtime.WindowsRuntime" />
|
||||
<Reference Include="System.Runtime.InteropServices.WindowsRuntime" />
|
||||
<Reference Include="Microsoft.Windows.Design.Extensibility">
|
||||
<Reference Include="Microsoft.VisualStudio.DesignTools.Extensibility">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Windows.Design.Interaction">
|
||||
<Reference Include="Microsoft.VisualStudio.DesignTools.Interaction">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
|
@ -62,12 +59,6 @@
|
|||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj" Condition="'$(ExcludeRestorePackageImports)' != 'true'">
|
||||
<Project>{daeb9cec-c817-33b2-74b2-bc379380db72}</Project>
|
||||
<Name>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid</Name>
|
||||
<Private>False</Private>
|
||||
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="WinRT References">
|
||||
<Reference Include="System.Xaml" />
|
||||
|
@ -84,9 +75,12 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MetadataRegistration.cs" />
|
||||
<Compile Include="Common\MetadataRegistrationBase.cs" />
|
||||
<Compile Include="Common\PlatformTypes.cs" />
|
||||
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Design\Common\Constants.cs" Link="Common\Constants.cs" />
|
||||
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Design\Common\MetadataRegistrationBase.cs" Link="Common\MetadataRegistrationBase.cs" />
|
||||
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Design\Common\PlatformTypes.cs" Link="Common\PlatformTypes.cs" />
|
||||
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Design\MetadataRegistration.cs" Link="MetadataRegistration.cs" />
|
||||
<Compile Include="Controls\DataGrid.Metadata.cs" />
|
||||
<Compile Include="Controls\DataGrid.Typedata.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
@ -95,31 +89,19 @@
|
|||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Common\ToolboxCategoryPaths.cs" />
|
||||
<Compile Include="DataGridMetadata.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\bin\$(Configuration)\uap10.0.17763\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.xml">
|
||||
<Link>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.xml</Link>
|
||||
<SubType>Designer</SubType>
|
||||
<Visible>False</Visible>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="Pack">
|
||||
<!-- No-op to avoid build error when packing solution from commandline -->
|
||||
</Target>
|
||||
<!-- No-op to avoid build error when packing solution from commandline -->
|
||||
<Target Name="Pack" />
|
||||
</Project>
|
|
@ -3,12 +3,9 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Windows Community Toolkit Controls DataGrid (Design)")]
|
||||
|
@ -20,12 +17,12 @@ using System.Windows;
|
|||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US English
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
|
@ -1,10 +1,10 @@
|
|||
<Project Sdk="MSBuild.Sdk.Extras">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>uap10.0.17763</TargetFramework>
|
||||
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
|
||||
<Title>Windows Community Toolkit Controls DataGrid</Title>
|
||||
<Description>
|
||||
This library provides a XAML DataGrid control. It is part of the Windows Community Toolkit.
|
||||
|
||||
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML DataGrid</PackageTags>
|
||||
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
|
||||
|
@ -14,7 +14,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
|
||||
<None Include="$(OutDir)\Design\$(MSBuildProjectName).Design.dll;$(OutDir)\Design\$(MSBuildProjectName).Design.pdb" Pack="true" PackagePath="lib\$(TargetFramework)\Design" />
|
||||
<None Include="$(OutDir)\Design\$(MSBuildProjectName).Design*.dll;$(OutDir)\Design\$(MSBuildProjectName).Design*.pdb" Pack="true" PackagePath="lib\$(TargetFramework)\Design" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -4,12 +4,17 @@
|
|||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
[assembly: SuppressMessage("General", "SWC1001:XmlDocumentationCommentShouldBeSpelledCorrectly", MessageId = "Theming", Justification = "Correct spelling")]
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design.Common
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
// HACK: Don't forget to update, if the namespace changes.
|
||||
public const string RootNamespace = "Microsoft.Toolkit.Uwp.UI.Controls";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Names for ToolboxCategoryAttribute.
|
||||
/// </summary>
|
|
@ -2,42 +2,55 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Linq;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.Design.Types;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.Design.Common
|
||||
{
|
||||
public class MetadataRegistrationBase
|
||||
public abstract class MetadataRegistrationBase : IProvideAttributeTable
|
||||
{
|
||||
private AttributeTable masterMetadataTable;
|
||||
|
||||
internal MetadataRegistrationBase() { }
|
||||
|
||||
/// <summary>
|
||||
/// Build design time metadata attribute table.
|
||||
/// </summary>
|
||||
/// <returns>Custom attribute table.</returns>
|
||||
protected virtual AttributeTable BuildAttributeTable()
|
||||
/// Build design time metadata attribute table.
|
||||
/// </summary>
|
||||
/// <returns>Custom attribute table.</returns>
|
||||
protected virtual AttributeTable BuildAttributeTable()
|
||||
{
|
||||
AttributeTableBuilder builder = new AttributeTableBuilder();
|
||||
var builder = new AttributeTableBuilder();
|
||||
|
||||
AddDescriptions(builder);
|
||||
AddAttributes(builder);
|
||||
AddTables(builder, this);
|
||||
|
||||
masterMetadataTable = builder.CreateTable();
|
||||
return masterMetadataTable;
|
||||
}
|
||||
|
||||
#region IProvideAttributeTable Members
|
||||
|
||||
/// <summary>
|
||||
/// Find all AttributeTableBuilder subclasses in the assembly
|
||||
/// Gets the AttributeTable for design time metadata.
|
||||
/// </summary>
|
||||
public AttributeTable AttributeTable => BuildAttributeTable();
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Find all AttributeTableBuilder subclasses in the assembly
|
||||
/// and add their attributes to the assembly attribute table.
|
||||
/// </summary>
|
||||
/// <param name="builder">The assembly attribute table builder.</param>
|
||||
|
@ -53,7 +66,7 @@ namespace Microsoft.Toolkit.Uwp.Design.Common
|
|||
{
|
||||
try
|
||||
{
|
||||
AttributeTableBuilder atb = (AttributeTableBuilder)Activator.CreateInstance(t);
|
||||
var atb = (AttributeTableBuilder)Activator.CreateInstance(t);
|
||||
builder.AddTable(atb.CreateTable());
|
||||
}
|
||||
catch (Exception)
|
||||
|
@ -75,7 +88,7 @@ namespace Microsoft.Toolkit.Uwp.Design.Common
|
|||
protected string AssemblyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create description attribute from run time assembly xml file.
|
||||
/// Create description attribute from run time assembly XML file.
|
||||
/// </summary>
|
||||
/// <param name="builder">The assembly attribute table builder.</param>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Design time dll should not fail.")]
|
||||
|
@ -83,36 +96,36 @@ namespace Microsoft.Toolkit.Uwp.Design.Common
|
|||
{
|
||||
Debug.Assert(builder != null, "AddDescriptions is called with null parameter!");
|
||||
|
||||
if (string.IsNullOrEmpty(XmlResourceName) ||
|
||||
string.IsNullOrEmpty(AssemblyFullName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
XDocument xdoc = null;
|
||||
if (string.IsNullOrEmpty(XmlResourceName) || string.IsNullOrEmpty(AssemblyFullName)) return;
|
||||
|
||||
XDocument xDoc;
|
||||
try
|
||||
{
|
||||
xdoc = XDocument.Load(new StreamReader(
|
||||
Assembly.GetExecutingAssembly().GetManifestResourceStream(XmlResourceName)));
|
||||
xDoc = XDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream(XmlResourceName));
|
||||
}
|
||||
catch { return; }
|
||||
if (xdoc == null)
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (XElement member in xdoc.Descendants("member"))
|
||||
if (xDoc == null) return;
|
||||
|
||||
foreach (XElement member in xDoc.Descendants("member"))
|
||||
{
|
||||
try
|
||||
{
|
||||
string name = (string)member.Attribute("name");
|
||||
if (name == null)
|
||||
continue;
|
||||
|
||||
if (name == null) continue;
|
||||
|
||||
bool isType = name.StartsWith("T:", StringComparison.OrdinalIgnoreCase);
|
||||
if (isType ||
|
||||
name.StartsWith("P:", StringComparison.OrdinalIgnoreCase))
|
||||
bool isProperty = name.StartsWith("P:", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (isType || isProperty)
|
||||
{
|
||||
int lastDot = name.Length;
|
||||
string typeName;
|
||||
|
||||
if (isType)
|
||||
{
|
||||
typeName = name.Substring(2); // skip leading "T:"
|
||||
|
@ -122,86 +135,74 @@ namespace Microsoft.Toolkit.Uwp.Design.Common
|
|||
lastDot = name.LastIndexOf('.');
|
||||
typeName = name.Substring(2, lastDot - 2);
|
||||
}
|
||||
typeName += AssemblyFullName;
|
||||
|
||||
Type t = Type.GetType(typeName);
|
||||
if (t != null && t.IsPublic && t.IsClass &&
|
||||
t.IsSubclassOf(Types.PlatformTypes.DependencyObjectType))
|
||||
var type = Type.GetType(typeName + ", " + AssemblyFullName);
|
||||
|
||||
if (type != null && type.IsPublic && type.IsClass && type.IsSubclassOf(PlatformTypes.DependencyObject))
|
||||
{
|
||||
string desc = ParseDescription(member);
|
||||
if (desc == null)
|
||||
continue;
|
||||
|
||||
desc = desc.Trim();
|
||||
desc = string.Join(" ", desc.Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries));
|
||||
if (desc == null) continue;
|
||||
|
||||
desc = string.Join(" ", desc.Trim().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries));
|
||||
|
||||
if (isType)
|
||||
{
|
||||
bool isBrowsable = true;
|
||||
try
|
||||
if (IsBrowsable(type))
|
||||
{
|
||||
isBrowsable = IsBrowsable(t);
|
||||
builder.AddCustomAttributes(typeName, new DescriptionAttribute(desc));
|
||||
}
|
||||
catch { isBrowsable = false; }
|
||||
if (isBrowsable)
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(new DescriptionAttribute(desc)));
|
||||
else //Hide from intellisense
|
||||
{
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(
|
||||
builder.AddCustomAttributes(typeName,
|
||||
new BrowsableAttribute(false),
|
||||
new Microsoft.Windows.Design.ToolboxBrowsableAttribute(false),
|
||||
new ToolboxItemAttribute(false)));
|
||||
new ToolboxBrowsableAttribute(false),
|
||||
new ToolboxItemAttribute(false));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string propName = name.Substring(lastDot + 1);
|
||||
PropertyInfo pi = t.GetProperty(propName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
|
||||
var propertyName = name.Substring(lastDot + 1);
|
||||
PropertyInfo pi = type.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
|
||||
if (pi != null)
|
||||
{
|
||||
bool isBrowsable = true;
|
||||
try
|
||||
if (IsBrowsable(type))
|
||||
{
|
||||
isBrowsable = IsBrowsable(pi);
|
||||
builder.AddCustomAttributes(typeName, propertyName, new DescriptionAttribute(desc));
|
||||
}
|
||||
catch { isBrowsable = false; }
|
||||
if (isBrowsable)
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(propName, new DescriptionAttribute(desc)));
|
||||
else //Hide from intellisense
|
||||
builder.AddCallback(t, b => b.AddCustomAttributes(new BrowsableAttribute(false)));
|
||||
{
|
||||
builder.AddCustomAttributes(typeName, new BrowsableAttribute(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
private static bool IsBrowsable(Type t)
|
||||
{
|
||||
var attrs = t.GetCustomAttributes(Types.PlatformTypes.EditorBrowsableAttributeType, false);
|
||||
foreach (var attr in attrs)
|
||||
{
|
||||
return Types.PlatformTypes.IsBrowsable(attr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool IsBrowsable(System.Reflection.PropertyInfo pi)
|
||||
private static bool IsBrowsable(MemberInfo typeOrMember)
|
||||
{
|
||||
var attrs = pi.GetCustomAttributes(Types.PlatformTypes.EditorBrowsableAttributeType, false);
|
||||
foreach (var attr in attrs)
|
||||
EditorBrowsableAttribute attribute;
|
||||
try
|
||||
{
|
||||
return Types.PlatformTypes.IsBrowsable(attr);
|
||||
attribute = typeOrMember.GetCustomAttribute<EditorBrowsableAttribute>(false);
|
||||
}
|
||||
return true;
|
||||
catch
|
||||
{
|
||||
return true; // If there is no [EditorBrowsable] attribute present, we'll show it by default.
|
||||
}
|
||||
return attribute.State != EditorBrowsableState.Never;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create description string from xml doc summary tag.
|
||||
/// Create description string from XML doc summary tag.
|
||||
/// </summary>
|
||||
/// <param name="member">A single node of the xml doc.</param>
|
||||
/// <param name="member">A single node of the XML doc.</param>
|
||||
/// <returns>Description string.</returns>
|
||||
private static string ParseDescription(XElement member)
|
||||
{
|
||||
|
|
|
@ -3,39 +3,23 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.Design.Types
|
||||
{
|
||||
internal class PlatformTypes
|
||||
{
|
||||
public static readonly Type DependencyObjectType = typeof(DependencyObject);
|
||||
public static readonly Type UIElementType = typeof(UIElement);
|
||||
public static readonly Type FrameworkElementType = typeof(FrameworkElement);
|
||||
public static readonly Type EditorBrowsableAttributeType = typeof(System.ComponentModel.EditorBrowsableAttribute);
|
||||
|
||||
/// <summary>
|
||||
/// Used by MetadataRegistrationBase to get the browsable state
|
||||
/// </summary>
|
||||
/// <param name="editorBrowsableAttribute">This parameter must be of type 'System.ComponentModel.EditorBrowsableAttribute'</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsBrowsable(object editorBrowsableAttribute)
|
||||
{
|
||||
if (editorBrowsableAttribute is System.ComponentModel.EditorBrowsableAttribute)
|
||||
return (editorBrowsableAttribute as System.ComponentModel.EditorBrowsableAttribute).State !=
|
||||
System.ComponentModel.EditorBrowsableState.Never;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class Control
|
||||
{
|
||||
public static readonly TypeIdentifier TypeId = new TypeIdentifier("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Control");
|
||||
public static readonly PropertyIdentifier BackgroundProperty = new PropertyIdentifier(TypeId, "Background");
|
||||
public static readonly PropertyIdentifier BorderBrushProperty = new PropertyIdentifier(TypeId, "BorderBrush");
|
||||
public static readonly PropertyIdentifier BorderThicknessProperty = new PropertyIdentifier(TypeId, "BorderThickness");
|
||||
}
|
||||
public static readonly Type DependencyObject = typeof(DependencyObject);
|
||||
public static readonly Type UIElement = typeof(UIElement);
|
||||
public static readonly Type FrameworkElement = typeof(FrameworkElement);
|
||||
public static readonly Type Control = typeof(Control);
|
||||
}
|
||||
|
||||
internal class XamlTypes
|
||||
{
|
||||
public static class FrameworkElement
|
||||
{
|
||||
public static readonly TypeIdentifier TypeId = new TypeIdentifier("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "FrameworkElement");
|
||||
|
@ -45,5 +29,13 @@ namespace Microsoft.Toolkit.Uwp.Design.Types
|
|||
public static readonly PropertyIdentifier HeightProperty = new PropertyIdentifier(TypeId, "Height");
|
||||
public static readonly PropertyIdentifier WidthProperty = new PropertyIdentifier(TypeId, "Width");
|
||||
}
|
||||
|
||||
public static class Control
|
||||
{
|
||||
public static readonly TypeIdentifier TypeId = new TypeIdentifier("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Control");
|
||||
public static readonly PropertyIdentifier BackgroundProperty = new PropertyIdentifier(TypeId, "Background");
|
||||
public static readonly PropertyIdentifier BorderBrushProperty = new PropertyIdentifier(TypeId, "BorderBrush");
|
||||
public static readonly PropertyIdentifier BorderThicknessProperty = new PropertyIdentifier(TypeId, "BorderThickness");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
[assembly: SuppressMessage("General", "SWC1001:XmlDocumentationCommentShouldBeSpelledCorrectly", MessageId = "Theming", Justification = "Correct spelling")]
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Names for ToolboxCategoryAttribute.
|
||||
/// </summary>
|
||||
internal static class ToolboxCategoryPaths
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic Controls category.
|
||||
/// </summary>
|
||||
public const string Toolkit = "Windows Community Toolkit";
|
||||
}
|
||||
}
|
|
@ -2,44 +2,43 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.Model;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class CustomDialogMetadata : AttributeTableBuilder
|
||||
{
|
||||
public CustomDialogMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(AdaptiveGridView),
|
||||
internal class CustomDialogMetadata : AttributeTableBuilder
|
||||
{
|
||||
public CustomDialogMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.AdaptiveGridView,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(AdaptiveGridView.DesiredWidth),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(AdaptiveGridView.ItemHeight),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(AdaptiveGridView.OneRowModeEnabled),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(AdaptiveGridView.StretchContentForSingleRow),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(AdaptiveGridView.ItemClickCommand),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string AdaptiveGridView = RootNamespace + "." + nameof(AdaptiveGridView);
|
||||
}
|
||||
|
||||
internal static class AdaptiveGridView
|
||||
{
|
||||
internal const string DesiredWidth = nameof(DesiredWidth);
|
||||
internal const string ItemClickCommand = nameof(ItemClickCommand);
|
||||
internal const string ItemHeight = nameof(ItemHeight);
|
||||
internal const string OneRowModeEnabled = nameof(OneRowModeEnabled);
|
||||
internal const string StretchContentForSingleRow = nameof(StretchContentForSingleRow);
|
||||
}
|
||||
}
|
|
@ -2,44 +2,43 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.Model;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
|
||||
internal class BladeItemMetadata : AttributeTableBuilder
|
||||
{
|
||||
public BladeItemMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(BladeItem),
|
||||
internal class BladeItemMetadata : AttributeTableBuilder
|
||||
{
|
||||
public BladeItemMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.BladeItem,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(BladeItem.TitleBarVisibility),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeItem.IsOpen),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeItem.TitleBarBackground),
|
||||
new CategoryAttribute(Properties.Resources.CategoryBrush)
|
||||
new CategoryAttribute(Resources.CategoryBrush)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeItem.CloseButtonBackground),
|
||||
new CategoryAttribute(Properties.Resources.CategoryBrush)
|
||||
new CategoryAttribute(Resources.CategoryBrush)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeItem.CloseButtonForeground),
|
||||
new CategoryAttribute(Properties.Resources.CategoryBrush)
|
||||
new CategoryAttribute(Resources.CategoryBrush)
|
||||
);
|
||||
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string BladeItem = RootNamespace + "." + nameof(BladeItem);
|
||||
}
|
||||
|
||||
internal static class BladeItem
|
||||
{
|
||||
internal const string CloseButtonBackground = nameof(CloseButtonBackground);
|
||||
internal const string CloseButtonForeground = nameof(CloseButtonForeground);
|
||||
internal const string IsOpen = nameof(IsOpen);
|
||||
internal const string TitleBarBackground = nameof(TitleBarBackground);
|
||||
internal const string TitleBarVisibility = nameof(TitleBarVisibility);
|
||||
}
|
||||
}
|
|
@ -2,47 +2,45 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.Model;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.PropertyEditing;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
|
||||
internal class BladeViewMetadata : AttributeTableBuilder
|
||||
{
|
||||
public BladeViewMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(BladeView),
|
||||
internal class BladeViewMetadata : AttributeTableBuilder
|
||||
{
|
||||
public BladeViewMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.BladeView,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(BladeView.ActiveBlades),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeView.BladeMode),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeView.AutoCollapseCountThreshold),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(BladeView.Items),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon),
|
||||
new CategoryAttribute(Resources.CategoryCommon),
|
||||
//The following is necessary because this is a collection of an abstract type, so we help
|
||||
//the designer with populating supported types that can be added to the collection
|
||||
new NewItemTypesAttribute(new System.Type[] {
|
||||
typeof(BladeItem),
|
||||
}),
|
||||
new NewItemTypesAttribute(ControlTypes.BladeItem),
|
||||
new AlternateContentPropertyAttribute()
|
||||
);
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string BladeView = RootNamespace + "." + nameof(BladeView);
|
||||
}
|
||||
|
||||
internal static class BladeView
|
||||
{
|
||||
internal const string ActiveBlades = nameof(ActiveBlades);
|
||||
internal const string AutoCollapseCountThreshold = nameof(AutoCollapseCountThreshold);
|
||||
internal const string BladeMode = nameof(BladeMode);
|
||||
internal const string Items = nameof(Items);
|
||||
}
|
||||
}
|
|
@ -2,36 +2,37 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class CarouselMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class CarouselMetadata : AttributeTableBuilder
|
||||
{
|
||||
public CarouselMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.Carousel),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Carousel.SelectedItem), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.SelectedIndex), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.TransitionDuration), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemDepth), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.EasingFunction), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemMargin), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.InvertPositive), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemRotationX), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemRotationY), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemRotationZ), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.Orientation), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.Carousel,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Carousel.SelectedItem), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.SelectedIndex), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.TransitionDuration), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemDepth), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.EasingFunction), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemMargin), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.InvertPositive), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemRotationX), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemRotationY), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.ItemRotationZ), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Carousel.Orientation), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string Carousel = RootNamespace + "." + nameof(Carousel);
|
||||
}
|
||||
|
||||
internal static class Carousel
|
||||
{
|
||||
internal const string EasingFunction = nameof(EasingFunction);
|
||||
internal const string InvertPositive = nameof(InvertPositive);
|
||||
internal const string ItemDepth = nameof(ItemDepth);
|
||||
internal const string ItemMargin = nameof(ItemMargin);
|
||||
internal const string ItemRotationX = nameof(ItemRotationX);
|
||||
internal const string ItemRotationY = nameof(ItemRotationY);
|
||||
internal const string ItemRotationZ = nameof(ItemRotationZ);
|
||||
internal const string Orientation = nameof(Orientation);
|
||||
internal const string SelectedIndex = nameof(SelectedIndex);
|
||||
internal const string SelectedItem = nameof(SelectedItem);
|
||||
internal const string TransitionDuration = nameof(TransitionDuration);
|
||||
}
|
||||
}
|
|
@ -2,14 +2,16 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.Model;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Features;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Model;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.PropertyEditing;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
|
||||
{
|
||||
|
@ -21,43 +23,43 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
|||
}
|
||||
}
|
||||
|
||||
internal class DropShadowPanelMetadata : AttributeTableBuilder
|
||||
{
|
||||
public DropShadowPanelMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(DropShadowPanel),
|
||||
internal class DropShadowPanelMetadata : AttributeTableBuilder
|
||||
{
|
||||
public DropShadowPanelMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.DropShadowPanel,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(new FeatureAttribute(typeof(DropShadowPanelDefaults)));
|
||||
|
||||
b.AddCustomAttributes(nameof(DropShadowPanel.BlurRadius),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Properties.Resources.CategoryDropShadow)
|
||||
new CategoryAttribute(Resources.CategoryDropShadow)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(DropShadowPanel.ShadowOpacity),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Properties.Resources.CategoryDropShadow)
|
||||
new CategoryAttribute(Resources.CategoryDropShadow)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(DropShadowPanel.Color),
|
||||
new CategoryAttribute(Properties.Resources.CategoryDropShadow)
|
||||
new CategoryAttribute(Resources.CategoryDropShadow)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(DropShadowPanel.OffsetX),
|
||||
new PropertyOrderAttribute(PropertyOrder.Late),
|
||||
new CategoryAttribute(Properties.Resources.CategoryDropShadow)
|
||||
new CategoryAttribute(Resources.CategoryDropShadow)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(DropShadowPanel.OffsetY),
|
||||
new PropertyOrderAttribute(PropertyOrder.Late),
|
||||
new CategoryAttribute(Properties.Resources.CategoryDropShadow)
|
||||
new CategoryAttribute(Resources.CategoryDropShadow)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(DropShadowPanel.OffsetZ),
|
||||
new PropertyOrderAttribute(PropertyOrder.Late),
|
||||
new CategoryAttribute(Properties.Resources.CategoryDropShadow)
|
||||
new CategoryAttribute(Resources.CategoryDropShadow)
|
||||
);
|
||||
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string DropShadowPanel = RootNamespace + "." + nameof(DropShadowPanel);
|
||||
}
|
||||
|
||||
internal static class DropShadowPanel
|
||||
{
|
||||
internal const string BlurRadius = nameof(BlurRadius);
|
||||
internal const string Color = nameof(Color);
|
||||
internal const string OffsetX = nameof(OffsetX);
|
||||
internal const string OffsetY = nameof(OffsetY);
|
||||
internal const string OffsetZ = nameof(OffsetZ);
|
||||
internal const string ShadowOpacity = nameof(ShadowOpacity);
|
||||
}
|
||||
}
|
|
@ -2,32 +2,33 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class ExpanderMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class ExpanderMetadata : AttributeTableBuilder
|
||||
{
|
||||
public ExpanderMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.Expander),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Expander.Header), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Expander.HeaderTemplate),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon),
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.Expander,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Expander.Header), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Expander.HeaderTemplate),
|
||||
new CategoryAttribute(Resources.CategoryCommon),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(Expander.IsExpanded), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Expander.ExpandDirection), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Expander.IsExpanded), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(Expander.ExpandDirection), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string Expander = RootNamespace + "." + nameof(Expander);
|
||||
}
|
||||
|
||||
internal static class Expander
|
||||
{
|
||||
internal const string ExpandDirection = nameof(ExpandDirection);
|
||||
internal const string Header = nameof(Header);
|
||||
internal const string HeaderTemplate = nameof(HeaderTemplate);
|
||||
internal const string IsExpanded = nameof(IsExpanded);
|
||||
}
|
||||
}
|
|
@ -2,36 +2,37 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class GridSplitterMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class GridSplitterMetadata : AttributeTableBuilder
|
||||
{
|
||||
public GridSplitterMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.GridSplitter),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(GridSplitter.Element), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.ResizeDirection), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.ResizeBehavior), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.GripperForeground), new CategoryAttribute(Properties.Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.ParentLevel), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.GripperCursor), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.GripperCustomCursorResource),
|
||||
new CategoryAttribute(Properties.Resources.CategoryAppearance),
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.GridSplitter,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(GridSplitter.Element), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.ResizeDirection), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.ResizeBehavior), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.GripperForeground), new CategoryAttribute(Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.ParentLevel), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.GripperCursor), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.GripperCustomCursorResource),
|
||||
new CategoryAttribute(Resources.CategoryAppearance),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(GridSplitter.CursorBehavior), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(GridSplitter.CursorBehavior), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string GridSplitter = RootNamespace + "." + nameof(GridSplitter);
|
||||
}
|
||||
|
||||
internal static class GridSplitter
|
||||
{
|
||||
internal const string CursorBehavior = nameof(CursorBehavior);
|
||||
internal const string Element = nameof(Element);
|
||||
internal const string GripperCursor = nameof(GripperCursor);
|
||||
internal const string GripperCustomCursorResource = nameof(GripperCustomCursorResource);
|
||||
internal const string GripperForeground = nameof(GripperForeground);
|
||||
internal const string ParentLevel = nameof(ParentLevel);
|
||||
internal const string ResizeBehavior = nameof(ResizeBehavior);
|
||||
internal const string ResizeDirection = nameof(ResizeDirection);
|
||||
}
|
||||
}
|
|
@ -2,26 +2,26 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class ImageExMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class ImageExMetadata : AttributeTableBuilder
|
||||
{
|
||||
public ImageExMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.ImageEx),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(ImageEx.NineGrid), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.ImageEx,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(ImageEx.NineGrid), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string ImageEx = RootNamespace + "." + nameof(ImageEx);
|
||||
}
|
||||
|
||||
internal static class ImageEx
|
||||
{
|
||||
internal const string NineGrid = nameof(NineGrid);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class InAppNotificationMetadata : AttributeTableBuilder
|
||||
{
|
||||
public InAppNotificationMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.InAppNotification,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(InAppNotification.ShowDismissButton), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string InAppNotification = RootNamespace + "." + nameof(InAppNotification);
|
||||
}
|
||||
|
||||
internal static class InAppNotification
|
||||
{
|
||||
internal const string ShowDismissButton = nameof(ShowDismissButton);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class LayoutTransformControlMetadata : AttributeTableBuilder
|
||||
{
|
||||
public LayoutTransformControlMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.LayoutTransformControl,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(LayoutTransformControl.Child), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(LayoutTransformControl.Transform), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string LayoutTransformControl = RootNamespace + "." + nameof(LayoutTransformControl);
|
||||
}
|
||||
|
||||
internal static class LayoutTransformControl
|
||||
{
|
||||
internal const string Child = nameof(Child);
|
||||
internal const string Transform = nameof(Transform);
|
||||
}
|
||||
}
|
|
@ -2,26 +2,27 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class LoadingMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class LoadingMetadata : AttributeTableBuilder
|
||||
{
|
||||
public LoadingMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.Loading),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Loading.IsLoading), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.Loading,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Loading.IsLoading), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string Loading = RootNamespace + "." + nameof(Loading);
|
||||
}
|
||||
|
||||
internal static class Loading
|
||||
{
|
||||
internal const string IsLoading = nameof(IsLoading);
|
||||
}
|
||||
}
|
|
@ -2,45 +2,46 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class MasterDetailsViewMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class MasterDetailsViewMetadata : AttributeTableBuilder
|
||||
{
|
||||
public MasterDetailsViewMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.MasterDetailsView),
|
||||
b =>
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.MasterDetailsView,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.SelectedItem), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.DetailsTemplate),
|
||||
new CategoryAttribute(Properties.Resources.CategoryAppearance),
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.SelectedItem), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.DetailsTemplate),
|
||||
new CategoryAttribute(Resources.CategoryAppearance),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterPaneBackground), new CategoryAttribute(Properties.Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterHeader), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterPaneBackground), new CategoryAttribute(Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterHeader), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterHeaderTemplate),
|
||||
new CategoryAttribute(Properties.Resources.CategoryAppearance),
|
||||
new CategoryAttribute(Resources.CategoryAppearance),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterPaneWidth), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.NoSelectionContent), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.NoSelectionContentTemplate),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon),
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterPaneWidth), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.NoSelectionContent), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.NoSelectionContentTemplate),
|
||||
new CategoryAttribute(Resources.CategoryCommon),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.ViewState), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterCommandBar), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.DetailsCommandBar), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.ViewState), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.MasterCommandBar), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(MasterDetailsView.DetailsCommandBar), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string MasterDetailsView = RootNamespace + "." + nameof(MasterDetailsView);
|
||||
}
|
||||
|
||||
internal static class MasterDetailsView
|
||||
{
|
||||
internal const string DetailsCommandBar = nameof(DetailsCommandBar);
|
||||
internal const string DetailsTemplate = nameof(DetailsTemplate);
|
||||
internal const string MasterCommandBar = nameof(MasterCommandBar);
|
||||
internal const string MasterHeader = nameof(MasterHeader);
|
||||
internal const string MasterHeaderTemplate = nameof(MasterHeaderTemplate);
|
||||
internal const string MasterPaneBackground = nameof(MasterPaneBackground);
|
||||
internal const string MasterPaneWidth = nameof(MasterPaneWidth);
|
||||
internal const string NoSelectionContent = nameof(NoSelectionContent);
|
||||
internal const string NoSelectionContentTemplate = nameof(NoSelectionContentTemplate);
|
||||
internal const string SelectedItem = nameof(SelectedItem);
|
||||
internal const string ViewState = nameof(ViewState);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.PropertyEditing;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class MenuMetadata : AttributeTableBuilder
|
||||
{
|
||||
public MenuMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.Menu,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(Menu.Items),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Resources.CategoryCommon),
|
||||
//The following is necessary because this is a collection of an abstract type, so we help
|
||||
//the designer with populating supported types that can be added to the collection
|
||||
new NewItemTypesAttribute(ControlTypes.MenuItem),
|
||||
new AlternateContentPropertyAttribute()
|
||||
);
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string Menu = RootNamespace + "." + nameof(Menu);
|
||||
}
|
||||
|
||||
internal static class Menu
|
||||
{
|
||||
internal const string Items = nameof(Items);
|
||||
}
|
||||
}
|
|
@ -2,48 +2,47 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.PropertyEditing;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class MenuItemMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class MenuItemMetadata : AttributeTableBuilder
|
||||
{
|
||||
public MenuItemMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(MenuItem),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(MenuItem.Header),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
);
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.MenuItem,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(MenuItem.Header),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(MenuItem.IsOpened),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(MenuItem.HeaderTemplate),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon)
|
||||
new CategoryAttribute(Resources.CategoryCommon)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(MenuItem.Items),
|
||||
new PropertyOrderAttribute(PropertyOrder.Early),
|
||||
new CategoryAttribute(Properties.Resources.CategoryCommon),
|
||||
new CategoryAttribute(Resources.CategoryCommon),
|
||||
//The following is necessary because this is a collection of an abstract type, so we help
|
||||
//the designer with populating supported types that can be added to the collection
|
||||
new NewItemTypesAttribute(new System.Type[] {
|
||||
typeof(MenuItem),
|
||||
}),
|
||||
new NewItemTypesAttribute(ControlTypes.MenuItem),
|
||||
new AlternateContentPropertyAttribute()
|
||||
);
|
||||
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
b.AddCustomAttributes(new ToolboxBrowsableAttribute(false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string MenuItem = RootNamespace + "." + nameof(MenuItem);
|
||||
}
|
||||
|
||||
internal static class MenuItem
|
||||
{
|
||||
internal const string Header = nameof(Header);
|
||||
internal const string HeaderTemplate = nameof(HeaderTemplate);
|
||||
internal const string IsOpened = nameof(IsOpened);
|
||||
internal const string Items = nameof(Items);
|
||||
}
|
||||
}
|
|
@ -2,36 +2,37 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class OrbitViewMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class OrbitViewMetadata : AttributeTableBuilder
|
||||
{
|
||||
public OrbitViewMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.OrbitView),
|
||||
b =>
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.OrbitView,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitsEnabled), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.IsItemClickEnabled), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.AnchorsEnabled), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.MinItemSize), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.MaxItemSize), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.AnchorColor), new CategoryAttribute(Properties.Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitColor), new CategoryAttribute(Properties.Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitDashArray), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.AnchorThickness), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitThickness), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.CenterContent), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitsEnabled), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.IsItemClickEnabled), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.AnchorsEnabled), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.MinItemSize), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.MaxItemSize), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.AnchorColor), new CategoryAttribute(Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitColor), new CategoryAttribute(Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitDashArray), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(OrbitView.AnchorThickness), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.OrbitThickness), new CategoryAttribute(Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(OrbitView.CenterContent), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string OrbitView = RootNamespace + "." + nameof(OrbitView);
|
||||
}
|
||||
|
||||
internal static class OrbitView
|
||||
{
|
||||
internal const string AnchorColor = nameof(AnchorColor);
|
||||
internal const string AnchorsEnabled = nameof(AnchorsEnabled);
|
||||
internal const string AnchorThickness = nameof(AnchorThickness);
|
||||
internal const string CenterContent = nameof(CenterContent);
|
||||
internal const string IsItemClickEnabled = nameof(IsItemClickEnabled);
|
||||
internal const string MaxItemSize = nameof(MaxItemSize);
|
||||
internal const string MinItemSize = nameof(MinItemSize);
|
||||
internal const string OrbitColor = nameof(OrbitColor);
|
||||
internal const string OrbitDashArray = nameof(OrbitDashArray);
|
||||
internal const string OrbitsEnabled = nameof(OrbitsEnabled);
|
||||
internal const string OrbitThickness = nameof(OrbitThickness);
|
||||
}
|
||||
}
|
|
@ -2,14 +2,13 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.Model;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Features;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Model;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class RadialGaugeDefaults : DefaultInitializer
|
||||
|
@ -21,12 +20,12 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
|||
}
|
||||
|
||||
internal class RadialGaugeMetadata : AttributeTableBuilder
|
||||
{
|
||||
{
|
||||
public RadialGaugeMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.RadialGauge),
|
||||
b =>
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.RadialGauge,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(new FeatureAttribute(typeof(RadialGaugeDefaults)));
|
||||
b.AddCustomAttributes(nameof(RadialGauge.Minimum), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
|
@ -51,8 +50,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
|||
b.AddCustomAttributes(nameof(RadialGauge.MinAngle), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(RadialGauge.MaxAngle), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string RadialGauge = RootNamespace + "." + nameof(RadialGauge);
|
||||
}
|
||||
|
||||
internal static class RadialGauge
|
||||
{
|
||||
internal const string IsInteractive = nameof(IsInteractive);
|
||||
internal const string MaxAngle = nameof(MaxAngle);
|
||||
internal const string Maximum = nameof(Maximum);
|
||||
internal const string MinAngle = nameof(MinAngle);
|
||||
internal const string Minimum = nameof(Minimum);
|
||||
internal const string NeedleBrush = nameof(NeedleBrush);
|
||||
internal const string NeedleLength = nameof(NeedleLength);
|
||||
internal const string NeedleWidth = nameof(NeedleWidth);
|
||||
internal const string ScaleBrush = nameof(ScaleBrush);
|
||||
internal const string ScalePadding = nameof(ScalePadding);
|
||||
internal const string ScaleTickWidth = nameof(ScaleTickWidth);
|
||||
internal const string ScaleWidth = nameof(ScaleWidth);
|
||||
internal const string StepSize = nameof(StepSize);
|
||||
internal const string TickBrush = nameof(TickBrush);
|
||||
internal const string TickLength = nameof(TickLength);
|
||||
internal const string TickSpacing = nameof(TickSpacing);
|
||||
internal const string TickWidth = nameof(TickWidth);
|
||||
internal const string TrailBrush = nameof(TrailBrush);
|
||||
internal const string Unit = nameof(Unit);
|
||||
internal const string Value = nameof(Value);
|
||||
internal const string ValueStringFormat = nameof(ValueStringFormat);
|
||||
}
|
||||
}
|
|
@ -2,13 +2,11 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Features;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.Model;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Features;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Model;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
|
@ -21,19 +19,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
|||
}
|
||||
|
||||
internal class RadialProgressBarMetadata : AttributeTableBuilder
|
||||
{
|
||||
{
|
||||
public RadialProgressBarMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.RadialProgressBar),
|
||||
b =>
|
||||
{
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.RadialProgressBar,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(new FeatureAttribute(typeof(RadialProgressBarDefaults)));
|
||||
b.AddCustomAttributes(nameof(RadialProgressBar.Thickness), new CategoryAttribute(Properties.Resources.CategoryAppearance));
|
||||
b.AddCustomAttributes(nameof(RadialProgressBar.Outline), new CategoryAttribute(Properties.Resources.CategoryBrush));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string RadialProgressBar = RootNamespace + "." + nameof(RadialProgressBar);
|
||||
}
|
||||
|
||||
internal static class RadialProgressBar
|
||||
{
|
||||
internal const string Outline = nameof(Outline);
|
||||
internal const string Thickness = nameof(Thickness);
|
||||
internal const string Value = nameof(Value);
|
||||
}
|
||||
}
|
|
@ -2,29 +2,30 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class RangeSelectorMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class RangeSelectorMetadata : AttributeTableBuilder
|
||||
{
|
||||
public RangeSelectorMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.RangeSelector),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(RangeSelector.Minimum), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RangeSelector.Maximum), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RangeSelector.RangeMin), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RangeSelector.RangeMax), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.RangeSelector,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(RangeSelector.Minimum), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RangeSelector.Maximum), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RangeSelector.RangeMin), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RangeSelector.RangeMax), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string RangeSelector = RootNamespace + "." + nameof(RangeSelector);
|
||||
}
|
||||
|
||||
internal static class RangeSelector
|
||||
{
|
||||
internal const string Maximum = nameof(Maximum);
|
||||
internal const string Minimum = nameof(Minimum);
|
||||
internal const string RangeMax = nameof(RangeMax);
|
||||
internal const string RangeMin = nameof(RangeMin);
|
||||
}
|
||||
}
|
|
@ -2,34 +2,35 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class RotatorTileMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class RotatorTileMetadata : AttributeTableBuilder
|
||||
{
|
||||
public RotatorTileMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.RotatorTile),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(RotatorTile.ExtraRandomDuration), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.RotationDelay), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.ItemsSource), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.ItemTemplate),
|
||||
new CategoryAttribute(Properties.Resources.CategoryAppearance),
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.RotatorTile,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(RotatorTile.ExtraRandomDuration), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.RotationDelay), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.ItemsSource), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.ItemTemplate),
|
||||
new CategoryAttribute(Resources.CategoryAppearance),
|
||||
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
|
||||
);
|
||||
b.AddCustomAttributes(nameof(RotatorTile.RotateDirection), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.CurrentItem), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.RotateDirection), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(nameof(RotatorTile.CurrentItem), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string RotatorTile = RootNamespace + "." + nameof(RotatorTile);
|
||||
}
|
||||
|
||||
internal static class RotatorTile
|
||||
{
|
||||
internal const string CurrentItem = nameof(CurrentItem);
|
||||
internal const string ExtraRandomDuration = nameof(ExtraRandomDuration);
|
||||
internal const string ItemsSource = nameof(ItemsSource);
|
||||
internal const string ItemTemplate = nameof(ItemTemplate);
|
||||
internal const string RotateDirection = nameof(RotateDirection);
|
||||
internal const string RotationDelay = nameof(RotationDelay);
|
||||
}
|
||||
}
|
|
@ -2,26 +2,27 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
|
||||
using Microsoft.Windows.Design;
|
||||
using Microsoft.Windows.Design.Metadata;
|
||||
using Microsoft.Windows.Design.PropertyEditing;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
|
||||
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility;
|
||||
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal class ScrollHeaderMetadata : AttributeTableBuilder
|
||||
{
|
||||
internal class ScrollHeaderMetadata : AttributeTableBuilder
|
||||
{
|
||||
public ScrollHeaderMetadata()
|
||||
: base()
|
||||
{
|
||||
AddCallback(typeof(Microsoft.Toolkit.Uwp.UI.Controls.ScrollHeader),
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(ScrollHeader.Mode), new CategoryAttribute(Properties.Resources.CategoryCommon));
|
||||
: base()
|
||||
{
|
||||
AddCallback(ControlTypes.ScrollHeader,
|
||||
b =>
|
||||
{
|
||||
b.AddCustomAttributes(nameof(ScrollHeader.Mode), new CategoryAttribute(Resources.CategoryCommon));
|
||||
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
|
||||
{
|
||||
internal static partial class ControlTypes
|
||||
{
|
||||
internal const string ScrollHeader = RootNamespace + "." + nameof(ScrollHeader);
|
||||
}
|
||||
|
||||
internal static class ScrollHeader
|
||||
{
|
||||
internal const string Mode = nameof(Mode);
|
||||
}
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче