Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mochengvia committed Mar 18, 2024
1 parent c7269ed commit 604aa50
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
Value="BottomRight" />
<Setter Property="local:DropDownHelper.VerticalOffset"
Value="0" />
<Setter Property="local:DropDownHelper.Width"
Value="150" />
<Setter Property="local:MenuHelper.TopLevelDropDownPlacement"
Value="{Binding Path=(local:DropDownHelper.Placement), RelativeSource={RelativeSource Self}, Mode=OneWay}" />
<Setter Property="local:MenuHelper.TopLevelDropDownVerticalOffset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
ResourceDictionaryLocation.SourceAssembly
)]

[assembly: AssemblyVersion("1.2.0.2")]
[assembly: AssemblyFileVersion("1.2.0.2")]
[assembly: AssemblyVersion("1.2.1")]
[assembly: AssemblyFileVersion("1.2.1")]
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ protected override void SetIncludeStyles()

foreach (var flag in Flags)
{
if (Includes.HasFlag(StyleDictionaryFlags.All) || Includes.HasFlag(flag))
if (Includes.HasFlag(StyleDictionaryFlags.All)
|| Includes.HasFlag(flag))
{
MergedDictionaries.Add(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/{flag}Style.xaml") });
AddToMergedDictionaries(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/{flag}Style.xaml") });
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;

namespace Panuon.WPF.UI.Resources
{
Expand All @@ -13,24 +12,31 @@ protected override void SetIncludeStyles()

foreach (var flag in Flags)
{
if (Includes.HasFlag(StyleDictionaryFlags.All) || Includes.HasFlag(flag))
if (Includes.HasFlag(StyleDictionaryFlags.All)
|| Includes.HasFlag(flag))
{
MergedDictionaries.Add(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/{flag}.xaml") });
AddToMergedDictionaries(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/{flag}.xaml") });

switch (flag)
switch (flag)
{
case StyleDictionaryFlags.ComboBox:
case StyleDictionaryFlags.ListBox:
case StyleDictionaryFlags.ListView:
case StyleDictionaryFlags.TreeView:
MergedDictionaries.Add(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/{flag}Item.xaml") });
case StyleDictionaryFlags.Menu:
AddToMergedDictionaries(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/{flag}Item.xaml") });
break;
case StyleDictionaryFlags.TabControl:
MergedDictionaries.Add(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/TabItem.xaml") });
AddToMergedDictionaries(new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/TabItem.xaml") });
break;
case StyleDictionaryFlags.ContextMenu:
var contextMenuItemDic = new SharedResourceDictionary() { Source = new Uri($"pack://application:,,,/Panuon.WPF.UI;component/Styles/MenuItem.xaml") };
AddToMergedDictionaries(contextMenuItemDic);
break;
}
}
}
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public StyleDictionaryFlags Includes

#region Methods
protected abstract void SetIncludeStyles();

protected void AddToMergedDictionaries(ResourceDictionary dictionary)
{
if (!MergedDictionaries.Contains(dictionary))
{
MergedDictionaries.Add(dictionary);
}
}
#endregion
}
}
}

0 comments on commit 604aa50

Please sign in to comment.