/************************************************************************************* Extended WPF Toolkit Copyright (C) 2007-2014 Xceed Software Inc. This program is provided to you under the terms of the Microsoft Public License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license For more features, controls, and fast professional support, pick up the Plus Edition at http://xceed.com/wpf_toolkit Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids ***********************************************************************************/ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Rating.Views { /// /// Interaction logic for RatingView.xaml /// public partial class RatingView : DemoView { public RatingView() { InitializeComponent(); } #if !OPEN_SOURCE private void ValueType_SelectionChanged( object sender, System.Windows.Controls.SelectionChangedEventArgs e ) { if( _valueType.SelectedValue != null ) { if( _valueType.SelectedValue.ToString() == RatingValueType.Exact.ToString() ) { _rating.Value = 2.5; _rating.ValueType = RatingValueType.Exact; _value.Visibility = System.Windows.Visibility.Visible; _percentage.Visibility = System.Windows.Visibility.Collapsed; } else { _rating.Value = 0.5; _rating.ValueType = RatingValueType.Percentage; _value.Visibility = System.Windows.Visibility.Collapsed; _percentage.Visibility = System.Windows.Visibility.Visible; } } } private void RatingItemsButton_Click( object sender, System.Windows.RoutedEventArgs e ) { CollectionControlDialog diag = new CollectionControlDialog(); diag.ItemsSource = _rating.Items; diag.NewItemTypes = new List() { typeof( RatingItem ) }; diag.ShowDialog(); } private void Rating_RatingValueChanged( object sender, System.Windows.RoutedPropertyChangedEventArgs e ) { // add custom handling here } #endif } }