App.xaml にある次のコードは、アプリケーション全体の静的リソースを定義し、リストボックス コントロールに正常にバインドしました。
<Application x:Class="cviko.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:cviko.Properties"
StartupUri="MainWindow.xaml">
<Application.Resources>
<CollectionViewSource x:Key="SStrings"
Source="{Binding Source={x:Static properties:Settings.Default}, Path=Strings}">
</CollectionViewSource>
</Application.Resources>
ただし、同じことをしたいのですが、代わりに別のプロジェクトで定義されたプロパティを使用します。このようなもの(コンパイル不可):
<Application x:Class="cviko.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:cviko.Properties"
//NEW
xmlns:props="clr-namespace:UIComponents.Properties"
StartupUri="MainWindow.xaml">
<Application.Resources>
//MODIFIED
<CollectionViewSource x:Key="SStrings"
Source="{Binding Source={x:Static props:Settings.Default}, Path=Nums}">
</CollectionViewSource>
</Application.Resources>
どんなアドバイスでも大歓迎です、ありがとう。