<UserControl x:Class="Example.ScatterPlotPanel" xmlns:local="clr-namespace:Exponent.Sensor.Pet.Analysis" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Name="_this" > <Grid> <telerik:RadPolarChart x:Name="chart" StartAngle="90"> <telerik:RadPolarChart.Grid> <telerik:PolarChartGrid GridLineVisibility="Both" StripesVisibility="Radial"> <telerik:PolarChartGrid.RadialStripeBrushes> <SolidColorBrush Color="#FFD7D7D7" Opacity="0.3" /> <SolidColorBrush Color="Transparent" /> </telerik:PolarChartGrid.RadialStripeBrushes> </telerik:PolarChartGrid> </telerik:RadPolarChart.Grid> <telerik:RadPolarChart.RadialAxis> <telerik:NumericRadialAxis ShowLabels="False" /> </telerik:RadPolarChart.RadialAxis> <telerik:RadPolarChart.PolarAxis> <telerik:PolarAxis Minimum="0" /> </telerik:RadPolarChart.PolarAxis> <telerik:RadPolarChart.Series> <telerik:PolarPointSeries x:Name="series" ItemsSource="{Binding ElementName=_this, Path=DataPoints}" AngleBinding="MissAngleDegrees" ValueBinding="MissDistanceMeters"> <telerik:PolarPointSeries.PointTemplate> <DataTemplate> <Ellipse Height="4" Width="4"> <Ellipse.Style> <Style TargetType="Ellipse"> <Setter Property="Fill" Value="Red"/> <Style.Triggers> <DataTrigger Binding="{Binding Path=DataItem.IsHit}" Value="True"> <Setter Property="Fill" Value="Green"/> </DataTrigger> </Style.Triggers> </Style> </Ellipse.Style> </Ellipse> </DataTemplate> </telerik:PolarPointSeries.PointTemplate> </telerik:PolarPointSeries> </telerik:RadPolarChart.Series> </telerik:RadPolarChart> <Button Content="Test" Click="OnUpdateDataPoints"/> </Grid></local:AnalysisPanel>public class AlarmData { private double missDistance; private double missAngle; private bool isHit; public AlarmData() { } public AlarmData(bool isHit, double missDistance, double missAngle) { this.isHit = isHit; this.missDistance = missDistance; this.missAngle = missAngle; } public bool IsHit { get { return isHit; } set { isHit = value; } } public double MissDistanceMeters { get { return missDistance.Meters; } } public double MissAngleDegrees { get { return missAngle.Degrees; } } } public partial class ScatterPlotPanel : UserControl, INotifyPropertyChanged { private List<AlarmData> dataPoints = new List<AlarmData>(); public event PropertyChangedEventHandler PropertyChanged; public ScatterPlotPanel() { InitializeComponent(); } protected void OnPropertyChanged(string propertyName) { try { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } catch (Exception ex) { } } protected override void OnUpdateDataPoints(object sender, RoutedEventArgs e) { dataPoints.Clear(); Random random = new Random(); for (int i = 0; i < 100; i++) { dataPoints.Add(new AlarmData(random.Next(0, 2) != 0, Distance.FromCentimeters(random.Next(0, 400)), Angle.FromDegrees(random.Next(0, 359)))); } OnPropertyChanged("DataPoints"); } public List<AlarmData> DataPoints { get { return dataPoints; } } }
Border Style="{StaticResource BorderCombo_Details}" Grid.Column="2" Grid.Row="3" Width="200" HorizontalAlignment="Left" VerticalAlignment="Top">
<telerikInput:RadComboBox x:Name="cmbFamilyCompositionWithSen" TabIndex="43" ToolTip="{x:Static Resx:Strings.Mselects_Tolltip}" Style="{StaticResource RadComboBoxCheack_Details}"
Validation.Error="Validation_Error" IsDropDownOpen="True" MaxDropDownHeight="40" StaysOpenOnEdit="True" FlowDirection="RightToLeft">
<telerik:RadComboBox.SelectionBoxTemplate>
<DataTemplate>
<TextBlock Text="{x:Null}"/>
</DataTemplate>
</telerik:RadComboBox.SelectionBoxTemplate>
<telerik:RadComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Path=FC_IsChecked,Mode=OneWay}" x:Name="cbxFamilyCompositionWithSen"
Tag="{Binding Path=FC_ID}" GotFocus="cbxOfCmb_GotFocus" Checked="AddRemoveFamliyCom" Unchecked="AddRemoveFamliyCom"/>
<TextBlock Text="{Binding Path=FC_Desc}"/>
</StackPanel>
</DataTemplate>
</telerik:RadComboBox.ItemTemplate>
</telerikInput:RadComboBox>
</Border>