beltrams Posted August 23, 2010 Report Share Posted August 23, 2010 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? Quote Link to comment Share on other sites More sharing options...
beltrams Posted August 24, 2010 Author Report Share Posted August 24, 2010 The second way I amtring to bind is with a string: public String SimoneVisibility { get return "Visible";}No success... Quote Link to comment Share on other sites More sharing options...
beltrams Posted August 27, 2010 Author Report Share Posted August 27, 2010 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}"> Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 27, 2010 Report Share Posted August 27, 2010 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 Quote Link to comment Share on other sites More sharing options...
beltrams Posted August 27, 2010 Author Report Share Posted August 27, 2010 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 Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 27, 2010 Report Share Posted August 27, 2010 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 Quote Link to comment Share on other sites More sharing options...
beltrams Posted September 1, 2010 Author Report Share Posted September 1, 2010 Thanks JuanC, I will try to install the lastest hotfix and see what happens. I will be back to you if I still have problems. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.