edreyes77 Posted February 25, 2011 Report Share Posted February 25, 2011 [color= blue]I am using a simple framework called BxF [/color] [color= blue][color= blue]and find that if I try to set the datacontext for the top grid in a usercontrol [/color] [color= blue]that the chartfx binding works only on data I initiate through the loaded events. [/color] [color= blue]If I refresh the value for the charts it will not work.[/color] [color= blue]if i set the datacontent without using a resource then it works. [/color] [color= blue]I would like to use the resource as that is part of the BxF framework pattern.[/color] [color= blue] [/color] [color= blue]<[/color][color= #a31515]UserControl[/color] x:Class="TheAcousticProject.Views.AcousticsWindow" xmlns:local="clr-namespace:TheAcousticProject.Views" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cfx="clr-namespace:ChartFX.WPF;assembly=ChartFX.WPF" xmlns:cfxconverters="http://schemas.softwarefx.com/chartfx/wpf/80/converters" xmlns:cfxcontrols="http://schemas.softwarefx.com/chartfx/wpf/80/controls" xmlns:cfx3d="http://schemas.softwarefx.com/chartfx/wpf/80/drawing3d" xmlns:cfxmotifs="http://schemas.softwarefx.com/chartfx/wpf/80/motifs " xmlns:vm="clr-namespace:TheAcousticProject.ViewModels" xmlns:bxf="http://schemas.lhotka.net/1.0.0/bxf" Loaded="OnWindowLoaded" mc:Ignorable="d" d:DesignHeight="900" d:DesignWidth="1400"> <UserControl.Resources> <CollectionViewSource x:Key="AcousticsModelViewSource" d:DesignSource="{d:DesignInstance vm:AcousticsViewModel, CreateList=True}" /> </UserControl.Resources> <Grid DataContext="{StaticResource AcousticsModelViewSource}" Background="#ffedf0e5"> [/color][color= blue]<[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart[/color][color= red] x[/color][color= blue]:[/color][color= red]Name[/color][color= blue]=[/color][color= blue]"abc"[/color][color= red] Margin[/color][color= blue]=[/color][color= blue]"1"[/color][color= red] Gallery[/color][color= blue]=[/color][color= blue]"Bar"[/color][color= red] ItemsSource[/color][color= blue]="{[/color][color= #a31515]Binding[/color][color= red] Path[/color][color= blue]=[/color][color= blue]BucketData[/color][color= blue],[/color][color= red] Mode[/color][color= blue]=[/color][color= blue]TwoWay[/color][color= blue]}[/color][color= blue]"[/color][color= blue] >[/color] <cfx:Chart> <cfx:Title Content="ABC" /> </cfx:Chart> <cfx:Chart.LegendBox> <cfx:LegendBox Visibility="Collapsed" /> </cfx:Chart.LegendBox> <cfx:Chart.DataView> <cfx:DataView Visibility="Collapsed" /> </cfx:Chart.DataView> <cfx:Chart.Series> <cfx:SeriesAttributes/> </cfx:Chart.Series> <cfx:Chart.AxisX> <cfx:Axis> <cfx:Axis.Grids> <cfx:Grids> <cfx:Grids.Major> <cfx:GridLine Visibility="Hidden"/> </cfx:Grids.Major> </cfx:Grids> </cfx:Axis.Grids> </cfx:Axis> </cfx:Chart.AxisX> <cfx:Chart.AxisY> <cfx:Axis> <cfx:Axis.Grids> <cfx:Grids> <cfx:Grids.Major> <cfx:GridLine Visibility="Hidden"/> </cfx:Grids.Major> </cfx:Grids> </cfx:Axis.Grids> </cfx:Axis> </cfx:Chart.AxisY> <cfx:Chart.PlotArea> <cfx:PlotAreaAttributes> <cfx:PlotAreaAttributes.Background> <ImageBrush Opacity="{Binding ElementName=slider1, Path=Value}" Stretch="UniformToFill" ImageSource="/Resources/SampleImage.jpg" /> </cfx:PlotAreaAttributes.Background> </cfx:PlotAreaAttributes> </cfx:Chart.PlotArea> <cfx:Chart.AllSeries> <cfx:AllSeriesAttributes> <cfx:AllSeriesAttributes.Template> <DataTemplate> <Canvas> <Canvas.Resources> <local:NegateConverter x:Key="negateConverter"/> </Canvas.Resources> <Rectangle Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="#404040" Stroke="#404040" StrokeThickness="{Binding Path=StrokeThickness}"> <Rectangle.BitmapEffect> <DropShadowBitmapEffect/> </Rectangle.BitmapEffect> </Rectangle> <Rectangle Canvas.Left="{Binding Path=Left, Converter={StaticResource negateConverter}}" Canvas.Top="{Binding Path=Top, Converter={StaticResource negateConverter}}" Width="{Binding Path=PlotWidth}" Height="{Binding Path=PlotHeight}" Clip="{Binding Path=BoundsGeometry}"> <Rectangle.Fill> <ImageBrush Stretch="UniformToFill" ImageSource="Resources/SampleImage.jpg"/> </Rectangle.Fill> </Rectangle> </Canvas> </DataTemplate> </cfx:AllSeriesAttributes.Template> </cfx:AllSeriesAttributes> </cfx:Chart.AllSeries> </cfx:Chart> [color= blue]</[/color][color= #a31515]Grid[/color][color= blue]>[/color] [color= blue]</[/color][color= #a31515]UserControl[/color][color= blue]>[/color] Quote Link to comment Share on other sites More sharing options...
JuanC Posted February 25, 2011 Report Share Posted February 25, 2011 Can you please create an empty project using BxF that contains a listbox and chart bound to some dummy data and post a zip file including the source and the bin folder? This will allow us to focus on trying to support your scenario as we have not used BxF before JuanC 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.