You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.3 KiB
69 lines
2.3 KiB
/*************************************************************************************
|
|
|
|
Toolkit for WPF
|
|
|
|
Copyright (C) 2007-2016 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 https://xceed.com/xceed-toolkit-plus-for-wpf/
|
|
|
|
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
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for RatingView.xaml
|
|
/// </summary>
|
|
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<System.Type>() { typeof( RatingItem ) };
|
|
diag.ShowDialog();
|
|
}
|
|
|
|
private void Rating_RatingValueChanged( object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e )
|
|
{
|
|
// add custom handling here
|
|
}
|
|
#endif
|
|
}
|
|
}
|
|
|