private static object CoerceSliceValue(DependencyObject d, object value) { // keep Slice in sync with EndAngle, StartAngle, and SweepDirection Pie pie = ( Pie )d; if (pie.IsUpdatingEndAngle || pie.IsUpdatingStartAngle || pie.IsUpdatingSweepDirection) { double slice = Math.Max(-360.0, Math.Min(360.0, (pie.EndAngle - pie.StartAngle))) / ((pie.SweepDirection == SweepDirection.Clockwise) ? 360.0 : -360.0); double newValue = DoubleHelper.AreVirtuallyEqual(slice, 0) ? 0 : (slice < 0) ? slice + 1 : slice; if (!DoubleHelper.AreVirtuallyEqual(( double )value, newValue)) { value = newValue; } } return(value); }
private static object CoerceEndAngleValue(DependencyObject d, object value) { // keep EndAngle in sync with Slice and SweepDirection Pie pie = ( Pie )d; if (pie.IsUpdatingSlice || pie.IsUpdatingSweepDirection || (pie.IsUpdatingStartAngle && pie.Mode == PieMode.Slice)) { double newValue = pie.StartAngle + ((pie.SweepDirection == SweepDirection.Clockwise) ? 1.0 : -1.0) * pie.Slice * 360; if (!DoubleHelper.AreVirtuallyEqual(( double )value, newValue)) { value = newValue; } } return(value); }
private static object CoerceSweepDirectionValue(DependencyObject d, object value) { // keep SweepDirection in sync with EndAngle and StartAngle Pie pie = ( Pie )d; if (pie.IsUpdatingEndAngle || pie.IsUpdatingStartAngle || pie.IsUpdatingMode) { if (DoubleHelper.AreVirtuallyEqual(pie.StartAngle, pie.EndAngle)) { // if the values are equal, use previously coerced value value = pie.SweepDirection; } else { value = (pie.EndAngle < pie.StartAngle) ? SweepDirection.Counterclockwise : SweepDirection.Clockwise; } } return(value); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.demo = ((Xceed.Wpf.Toolkit.LiveExplorer.Samples.Pie.Views.PieView)(target)); return; case 2: #line 79 "..\..\..\..\..\..\Samples\Pie\Views\PieView.xaml" ((System.Windows.Controls.ComboBox)(target)).SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ComboBox_SelectionChanged); #line default #line hidden return; case 3: this.endAngleSlider = ((System.Windows.Controls.Slider)(target)); return; case 4: this.sliceSlider = ((System.Windows.Controls.Slider)(target)); return; case 5: this.FillSelector = ((Xceed.Wpf.Toolkit.ColorPicker)(target)); return; case 6: this.StrokeSelector = ((Xceed.Wpf.Toolkit.ColorPicker)(target)); return; case 7: this.pie = ((Xceed.Wpf.Toolkit.Pie)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 2: this.PieDataListBox = ((System.Windows.Controls.ListBox)(target)); return; case 3: this.PiesViewbox = ((System.Windows.Controls.Viewbox)(target)); return; case 4: this.PiesGrid = ((System.Windows.Controls.Grid)(target)); return; case 5: this.WaterPie = ((Xceed.Wpf.Toolkit.Pie)(target)); return; case 6: this.LactosePie = ((Xceed.Wpf.Toolkit.Pie)(target)); return; case 7: this.FatPie = ((Xceed.Wpf.Toolkit.Pie)(target)); return; case 8: this.ProteinPie = ((Xceed.Wpf.Toolkit.Pie)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.PiesViewbox = ((System.Windows.Controls.Canvas)(target)); return; case 2: this.PiesGrid = ((System.Windows.Controls.Canvas)(target)); return; case 3: this.FatPie = ((Xceed.Wpf.Toolkit.Pie)(target)); #line 54 "..\..\PieChartWindow.xaml" this.FatPie.MouseEnter += new System.Windows.Input.MouseEventHandler(this.FatPie_MouseEnter); #line default #line hidden #line 55 "..\..\PieChartWindow.xaml" this.FatPie.MouseLeave += new System.Windows.Input.MouseEventHandler(this.FatPie_MouseLeave); #line default #line hidden return; case 4: this.ProteinPie = ((Xceed.Wpf.Toolkit.Pie)(target)); #line 73 "..\..\PieChartWindow.xaml" this.ProteinPie.MouseEnter += new System.Windows.Input.MouseEventHandler(this.ProteinPie_MouseEnter); #line default #line hidden #line 74 "..\..\PieChartWindow.xaml" this.ProteinPie.MouseLeave += new System.Windows.Input.MouseEventHandler(this.ProteinPie_MouseLeave); #line default #line hidden return; case 5: this.lineproteinPie1 = ((System.Windows.Shapes.Line)(target)); return; case 6: this.lineproteinPie2 = ((System.Windows.Shapes.Line)(target)); return; case 7: this.FatPie1 = ((System.Windows.Shapes.Line)(target)); return; case 8: this.FatPie2 = ((System.Windows.Shapes.Line)(target)); return; case 9: this.textFatpie = ((System.Windows.Controls.Label)(target)); return; case 10: this.textProteinPie = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }