Sonntag, 5. September 2010

Um in diesem Forum zu schreiben, bitte registrieren oder anmelden (siehe Link oben rechts auf dieser Seite). Das Registrieren ist kostenlos und wird sofort wirksam.

Forum
 
  Forum  PCPANEL.NET  Questions, Requ...  DataBinding HVLevelIndicator
vorherige vorherige
 
Nächste deaktiviert
neuer Beitrag 26.07.2010 15:32
erledigt
  javi
2 Beiträge
keine Bewertung


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.

 
neuer Beitrag 26.07.2010 20:17
Antwort zulassen 
  SuperUser Account
1 Beiträge
keine Bewertung


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

 

 

 
neuer Beitrag 28.07.2010 16:27
  javi
2 Beiträge
keine Bewertung


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!! :)

 

 

 

 
vorherige vorherige
 
Nächste deaktiviert
  Forum  PCPANEL.NET  Questions, Requ...  DataBinding HVLevelIndicator
Datenschutzerklärung  |  Nutzungsbedingungen
Copyright 2009 by AIT Software GmbH