March 13th, 2012 02:28 AM
#1
Binding Fill property to value of node with particular id in XML
Hi there, I have this XML file:
<?xml version="1.0" encoding="utf-8"?>
<Wpf>
<wpfctrl id="NavBtnTemplate">#FFCFDEFF</wpfctrl>
</Wpf>
and i want to bind Fill property of My Rectangle to value of wpfctrl node with id="NavBtnTemplate". How I can achieve this? Actually I have this rectangle inside my custom UserControl's Control Template. But hope that will not be the problem since I can bind to the properties of elements inside UserControl:
My UserControl (actually is very simple)
<UserControl.Resources>
<ControlTemplate x:Key="WpfWebSparkNavTemplate" TargetType="{x:Type Button}">
<Grid x:Name="controlLayout" Height="29.648" Width="84.284">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="rectangle"Fill="#FFCFDEFF" Margin="0" Height="31" d:LayoutOverrides="VerticalAlignment" >
</Rectangle>
<Label x:Name="buttonCaption" VerticalAlignment = "Center"
HorizontalAlignment = "Center"
FontWeight = "Bold" FontSize = "12" Content="{TemplateBinding Content}"/>
</Grid>
</ControlTemplate>
</UserControl.Resources>
I did not found Blend wizard to allow me to state such filters on XML
Please help. Thank you.
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks