Sunday, September 05, 2010

Please register or login (see links at the top-right corner of this page) to post in this Forum. Registration is free and becomes valid immediately.

Forum
 
  Forum  PCPANEL.NET  Questions, Requ...  DataBinding HVLevelIndicator
Previous Previous
 
Next Disabled
New Post 7/26/2010 3:32 PM
Resolved
  javi
2 posts
No Ranking


DataBinding HVLevelIndicator 

Hi,

how can i binding currentValue to a variable or property located at the container class?.

I have done a binding to a slider and it runs ok, but i cant binding a integer variable to current value property to de HVlevelIndicator.

thanks.

 
New Post 7/26/2010 8:17 PM
Accepted Answer 
  SuperUser Account
1 posts
No Ranking


Re: DataBinding HVLevelIndicator 

Hello,

you need to bind to the CurrentValue property of the HVLevelIndicator control.

If, for example, you have a property named "TheCurrentValue" in a XAML windows and the HLLevelIndicator is part of that window, then the syntax could look like this:

<Window x:Class="SampleProject.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300"
    xmlns:pcp="clr-namespace:AITSW.PCPANEL.WPF;assembly=PCPANEL_WPF_Controls">
    <Grid>
        <pcp:HVLevelIndicator
            Height="38" Margin="21,88,20,0" Name="hVLevelIndicator1" VerticalAlignment="Top"
            CurrentValue="{Binding Path=TheCurrentValue, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
    </Grid>
</Window>

 

Hope that helps
Christian

 

 

 
New Post 7/28/2010 4:27 PM
  javi
2 posts
No Ranking


Re: DataBinding HVLevelIndicator 

 it works perfectly, thanks!!

i use visual studio 2010, so (i think, never work with wpf before), at the binding expresion i have to write "RelativeSource Mode=FindAncestor"

instead of "RelativeSource FindAncestor".

 

thanks a lot!! :)

 

 

 

 
Previous Previous
 
Next Disabled
  Forum  PCPANEL.NET  Questions, Requ...  DataBinding HVLevelIndicator
Privacy Statement  |  Terms Of Use
Copyright 2009 by AIT Software GmbH