現在Generic.xaml、カスタムクラスインスタンスを使用して定義しています。以下のように:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/TextPicker;component/Themes/FiltersTreeView.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
そして、FiltersTreeView.xaml私は自分のcutomizedUIクラスのインスタンスを定義します。
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utils="clr-namespace:TextPicker.Utils"
xmlns:cmd="clr-namespace:TextPicker.Commands"
xmlns:cc="clr-namespace:TextPicker.CustomControls"
xmlns:dm="clr-namespace:TextPicker.Models">
<cc:ColorPiePopup x:Key="colorPiePopup"/>
....
<ResourceDictionary/>
そして今、私Application.Current.FindResourceはそれを見つけるために使用しようとしますが、それは常に戻りnullます。
では、どうすればこのリソースをから定義できGeneric.xamlますか?私はコードを使用することを意味します。