-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sergey M
committed
Aug 29, 2020
1 parent
6f04022
commit 701475c
Showing
9 changed files
with
144 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- Design-time only resource --> | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="pack://application:,,,/DPackRx;component/UI/Styles/FeatureDictionary.xaml" /> | ||
<ResourceDictionary Source="pack://application:,,,/DPackRx;component/UI/Styles/OptionsDictionary.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Windows; | ||
|
||
namespace DPackRx.UI | ||
{ | ||
/// <summary> | ||
/// Provides cached hash table / dictionary implementation that contains WPF resources used by components and other elements of a WPF application. | ||
/// </summary> | ||
public class SharedResourceDictionary : ResourceDictionary | ||
{ | ||
#region Fields | ||
|
||
private Uri _sourceUri; | ||
private static readonly Dictionary<Uri, ResourceDictionary> _sharedDictionaries = new Dictionary<Uri, ResourceDictionary>(10); | ||
|
||
#endregion | ||
|
||
#region Properties | ||
|
||
/// <summary> | ||
/// Uniform resource identifier (URI) to load resources from. | ||
/// </summary> | ||
public new Uri Source | ||
{ | ||
get { return _sourceUri; } | ||
set | ||
{ | ||
_sourceUri = value; | ||
|
||
if (value != null) | ||
{ | ||
if (_sharedDictionaries.ContainsKey(value)) | ||
{ | ||
this.MergedDictionaries.Add(_sharedDictionaries[value]); | ||
} | ||
else | ||
{ | ||
// Load the dictionary by setting the source of the base class | ||
base.Source = value; | ||
|
||
_sharedDictionaries.Add(value, this); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |