简体   繁体   中英

Add Resource in code behind

I tried searching how to add Resources in code behind. Need to add the following in code behind

 <DockManager:XamDockManager.Resources>

                <SolidColorBrush x:Key="{x:Static DockManager:DockManagerBrushKeys.TabbedListActiveTextFillKey}" Color="Green"/>
                <SolidColorBrush x:Key="{x:Static DockManager:DockManagerBrushKeys.TabbedListNotActiveTextFillKey}" Color="Pink"/>


        </DockManager:XamDockManager.Resources>

The Dockmanager is created in the code behind

Thanks

How about

var foo = new Foo();
XamDockManager dm = new XamDockManager...
dm.Resources.Add("foo", foo);

See also here: http://msdn.microsoft.com/en-us/library/ms752326.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM