Jump to content
Software FX Community

Visibility Binding


beltrams

Recommended Posts

I am trying to bind the Visibility to my ViemModel and it looks like no bind take place.

I am tring to do the following:

<cfx:AllSeriesAttributes.PointLabels>

<cfx:PointLabelAttributes Visibility="{Binding Path=SimoneVisibility, Mode=OneWay}">I have tried to return a string and also a System.Windows.Visibility enum

public Visibility SimoneVisibility

{

get return Visibility.Visible;}OR

public Visibility SimoneVisibility

{

get return Visibility.Visible;}

Similat happns for

<cfx:Chart.LegendBox>

<cfx:LegendBox Visibility="{Binding Path=LegendBoxVisibility, Mode=OneWay}" />

Legend box always show and point labels never, if I try to bind them. 

ALL the other bindings are working fine, only the visibility does not. Is it supported?

Link to comment
Share on other sites

As workarond I have set up two text fields:

<TextBox Name="LegendBoxVisibilityDummyTextBox" Text="{Binding Path=LegendBoxVisibility, Mode=OneWay}" Visibility="Collapsed"></TextBox>

<TextBox Name="PointLabelAttributesVisibilityDummyTextBox" Text="{Binding Path=PointLabelAttributesVisibility, Mode=OneWay}" Visibility="Collapsed"></TextBox>

And the this binding for the legend box visibility:

<

cfx:LegendBox cfx:Chart.TargetPanel="Inside" HorizontalAlignment="Right" VerticalAlignment="Top" Visibility="{Binding Path=Text, ElementName=LegendBoxVisibilityDummyTextBox, Mode=OneWay}">

This seems to work as woraround. I have tried the same for the point labels but it does NOT work:

<

cfx:PointLabelAttributes Visibility="{Binding Path=Text, ElementName=PointLabelAttributesVisibilityDummyTextBox, Mode=OneWay}">
Link to comment
Share on other sites

Build 3890 should fix the binding issues related to AllSeries and PointLabels, I tested the bindings similar to your original post but setting up bindings to controls in the same page instead of using a viewmode, please note that for Visibility properties you need to use a converter.

I could not duplicate the binding issues with the legend box, are you sure your code is not setting this property manually and thus removing the binding? Have you tried using a converter?

JuanC

Link to comment
Share on other sites

Thanks again JuanC,

I am using version 8.0.3581.26941

I havent tried to use a converter. Originally I was bing directly to the property (Returning Visibility type) in the view model both legend visivility and text box visibility. The thext box visibility was fine but not the legend box.

For the point label attribute might it be because if I over with the mouse I see it uses PointLabelAttributes.Visibility and not a UIElement.Visibilty type (like the legend box does?)

Do I need a converter even if I use a Visibility type? I dont care to use a boolean as I bind to a property of the view model.

Simone

Link to comment
Share on other sites

You only need a converter if the property type does not match (I mentioned it because one of the posts included the property as a string). I tested binding both the PointLabels.Visibility and LegendBox.Visibility to a checkbox so I had to use it to bind it to IsChecked. It worked fine.

You can download our most recent hotfix here (make sure you run IE as an Administrator if UAC is enabled).

JuanC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...