Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Getting a ResourceDictionary of Brushes into an ItemsList

$
0
0
I have a number of XAML `Brush` objects defined in my project. Some are relatively detailed. Right now they're all located in Application.xaml, like so:

       <Application.Resources>
            <ResourceDictionary>
            <LinearGradientBrush x:Key="FiveColorGradient"  >
              ...with five gradient stops
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="TwentyFourColorGradient" >
                ...with 24 gradient stops
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="RedYellowGradient" >
                ...etc
            </LinearGradientBrush>
                <SolidColorBrush x:Key="TransparentReportBrush" Color="#40222222"/>
                <SolidColorBrush x:Key="CuttingPlaneTempBrush" Color="Black" />
                <SolidColorBrush x:Key="RedBrush" Color="Red" />
                <SolidColorBrush x:Key="GreenBrush" Color="Green" />
                <SolidColorBrush x:Key="BlueBrush" Color="Blue" />
            </ResourceDictionary>
        </Application.Resources>

The question is, how do I get those items loaded into an `ItemsList` control, such as a `ComboBox`? 

(I've tried looking up several ideas, but none are supported by any documentation that isn't thoroughly buried in content aggregation or years of dust...)

-- Rob


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>