Fix for DefaultStyleKey not working always when assembly name differs from namespace.

This commit is contained in:
Alexandre Zollinger Chohfi 2021-09-17 11:12:44 -07:00
Родитель 02a4d2bc3e
Коммит 323e006837
13 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -77,6 +77,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public CameraPreview() public CameraPreview()
{ {
this.DefaultStyleKey = typeof(CameraPreview); this.DefaultStyleKey = typeof(CameraPreview);
this.DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
} }
/// <inheritdoc/> /// <inheritdoc/>

Просмотреть файл

@ -33,6 +33,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public DropShadowPanel() public DropShadowPanel()
{ {
this.DefaultStyleKey = typeof(DropShadowPanel); this.DefaultStyleKey = typeof(DropShadowPanel);
this.DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode) if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode)
{ {

Просмотреть файл

@ -18,6 +18,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
: base() : base()
{ {
DefaultStyleKey = typeof(ImageEx); DefaultStyleKey = typeof(ImageEx);
DefaultStyleResourceUri = new System.Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
} }
} }
} }

Просмотреть файл

@ -35,6 +35,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public InAppNotification() public InAppNotification()
{ {
DefaultStyleKey = typeof(InAppNotification); DefaultStyleKey = typeof(InAppNotification);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
_dispatcherQueue = DispatcherQueue.GetForCurrentThread(); _dispatcherQueue = DispatcherQueue.GetForCurrentThread();
_dismissTimer = _dispatcherQueue.CreateTimer(); _dismissTimer = _dispatcherQueue.CreateTimer();

Просмотреть файл

@ -23,6 +23,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public Loading() public Loading()
{ {
DefaultStyleKey = typeof(Loading); DefaultStyleKey = typeof(Loading);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
} }
/// <inheritdoc/> /// <inheritdoc/>

Просмотреть файл

@ -24,6 +24,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public Menu() public Menu()
{ {
DefaultStyleKey = typeof(Menu); DefaultStyleKey = typeof(Menu);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
} }
// even if we have multiple menus in the same page we need only one cache because only one menu item will have certain short cut. // even if we have multiple menus in the same page we need only one cache because only one menu item will have certain short cut.

Просмотреть файл

@ -65,6 +65,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public MetadataControl() public MetadataControl()
{ {
DefaultStyleKey = typeof(MetadataControl); DefaultStyleKey = typeof(MetadataControl);
DefaultStyleResourceUri = new System.Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
ActualThemeChanged += OnActualThemeChanged; ActualThemeChanged += OnActualThemeChanged;
} }

Просмотреть файл

@ -119,6 +119,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public RadialProgressBar() public RadialProgressBar()
{ {
DefaultStyleKey = typeof(RadialProgressBar); DefaultStyleKey = typeof(RadialProgressBar);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
SizeChanged += SizeChangedHandler; SizeChanged += SizeChangedHandler;
} }

Просмотреть файл

@ -84,6 +84,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public RotatorTile() public RotatorTile()
{ {
DefaultStyleKey = typeof(RotatorTile); DefaultStyleKey = typeof(RotatorTile);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
Unloaded += RotatorTile_Unloaded; Unloaded += RotatorTile_Unloaded;
Loaded += RotatorTile_Loaded; Loaded += RotatorTile_Loaded;

Просмотреть файл

@ -38,7 +38,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public TabbedCommandBar() public TabbedCommandBar()
{ {
DefaultStyleKey = typeof(TabbedCommandBar); DefaultStyleKey = typeof(TabbedCommandBar);
DefaultStyleResourceUri = new System.Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml"); DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
SelectionChanged += SelectedItemChanged; SelectionChanged += SelectedItemChanged;
Loaded += TabbedCommandBar_Loaded; Loaded += TabbedCommandBar_Loaded;

Просмотреть файл

@ -23,6 +23,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public TabbedCommandBarItem() public TabbedCommandBarItem()
{ {
DefaultStyleKey = typeof(TabbedCommandBarItem); DefaultStyleKey = typeof(TabbedCommandBarItem);
DefaultStyleResourceUri = new System.Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
} }
/// <summary> /// <summary>

Просмотреть файл

@ -30,6 +30,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public TextToolbar() public TextToolbar()
{ {
DefaultStyleKey = typeof(TextToolbar); DefaultStyleKey = typeof(TextToolbar);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
CustomButtons = new ButtonMap(); CustomButtons = new ButtonMap();
ButtonModifications = new DefaultButtonModificationList(); ButtonModifications = new DefaultButtonModificationList();

Просмотреть файл

@ -66,6 +66,7 @@ namespace CommunityToolkit.WinUI.UI.Controls
public TileControl() public TileControl()
{ {
DefaultStyleKey = typeof(TileControl); DefaultStyleKey = typeof(TileControl);
DefaultStyleResourceUri = new Uri("ms-appx:///CommunityToolkit.WinUI.UI.Controls.Core/Themes/Generic.xaml");
InitializeAnimation(); InitializeAnimation();
} }