public Example() { if (ApplicationThemeManager.GetInstance().CurrentTheme == "Windows8Touch") { this.Resources.MergedDictionaries.Add(new System.Windows.ResourceDictionary() { Source = new Uri("/Gauge;component/Customization/LinearTickMarks/Win8TouchResources.xaml", UriKind.RelativeOrAbsolute) }); } else { this.Resources.MergedDictionaries.Add(new System.Windows.ResourceDictionary() { Source = new Uri("/Gauge;component/Customization/LinearTickMarks/Win8Resources.xaml", UriKind.RelativeOrAbsolute) }); } InitializeComponent(); DataTemplateItemsSource tickTemplateSource = new DataTemplateItemsSource(); tickTemplateSource.Add("Default", (DataTemplate)this.Resources["DefaultTickShape"]); tickTemplateSource.Add("Dashed", (DataTemplate)this.Resources["DashedTickShape"]); this.majorTickStyle.ItemsSource = tickTemplateSource; SetupBinding(this.majorTickStyle, RadComboBox.SelectedItemProperty, this.linearScale, GraphicScale.MajorTickTemplateProperty, tickTemplateSource); this.isInitialized = true; this.SetWayChanged(null, null); this.MajorTickSizeChanged(null, null); this.MiddleTickSizeChanged(null, null); this.MinorTickSizeChanged(null, null); }
public Example() { InitializeComponent(); DataTemplateItemsSource itemsSource = new DataTemplateItemsSource(); itemsSource.Add("Default", (DataTemplate)Resources["DefaultTickShape"]); itemsSource.Add("Ellipse", (DataTemplate)Resources["EllipseTickShape"]); itemsSource.Add("Triangle", (DataTemplate)Resources["TriangleTickShape"]); majorTickStyle.ItemsSource = itemsSource; middleTickStyle.ItemsSource = itemsSource; minorTickStyle.ItemsSource = itemsSource; SetupBinding(majorTickStyle, RadComboBox.SelectedItemProperty, radialScale.MajorTick, TickProperties.ItemTemplateProperty, itemsSource); SetupBinding(middleTickStyle, RadComboBox.SelectedItemProperty, radialScale.MiddleTick, TickProperties.ItemTemplateProperty, itemsSource); SetupBinding(minorTickStyle, RadComboBox.SelectedItemProperty, radialScale.MinorTick, TickProperties.ItemTemplateProperty, itemsSource); majorTicks.Value = 10; majorLength.Value = 0.08; showLastTick.IsChecked = true; middleTicks.Value = 2; middleLength.Value = 0.06; minorTicks.Value = 2; minorLength.Value = 0.04; tickValue.Value = 43; radialScale.MajorTickStep = double.NaN; init = true; this.Loaded += new RoutedEventHandler(TickMarks_Loaded); }
public Example() { if (ApplicationThemeManager.GetInstance().CurrentTheme == "Windows8Touch") { this.Resources.MergedDictionaries.Add(new System.Windows.ResourceDictionary() { Source = new Uri("/Gauge;component/Customization/CustomLabels/Win8TouchResources.xaml", UriKind.RelativeOrAbsolute) }); } else { this.Resources.MergedDictionaries.Add(new System.Windows.ResourceDictionary() { Source = new Uri("/Gauge;component/Customization/CustomLabels/Win8Resources.xaml", UriKind.RelativeOrAbsolute) }); } InitializeComponent(); DataTemplateItemsSource labelSource = new DataTemplateItemsSource(); labelSource.Add("Default", (DataTemplate)this.Resources["FontLabelTemplate"]); labelSource.Add("Image", (DataTemplate)this.Resources["ImageTextLabelAppearance"]); labelTemplate.ItemsSource = labelSource; SetupBinding(labelTemplate, RadComboBox.SelectedItemProperty, radialScale, GraphicScale.LabelTemplateProperty, labelSource); this.relative.IsChecked = true; }