<UserControl x:Class="WMITest.PercentUtilizationGauge" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
xmlns:local="clr-namespace:WMITest" |
Height="300" Width="300"> |
<UserControl.Resources> |
<local:GaugeSettings x:Key="DataSource"/> |
</UserControl.Resources> |
<telerik:RadGauge DataContext="{Binding Source={StaticResource DataSource}}"> |
<Grid> |
<telerik:RadialGauge HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<telerik:RadialScale LabelRotationMode="None" Name="radialScale" Min="0" Max="100"> |
<telerik:RangeList> |
<telerik:RadialRange Name="Green" Min="0" Max="{Binding GreenZoneEnd}" StartWidth="0.1" EndWidth="0.1" |
Location="OverCenter" Background="Green" BorderBrush="Green" Opacity="0.8"/> |
<telerik:RadialRange Name="Yellow" Min="{Binding GreenZoneEnd}" Max="{Binding YellowZoneEnd}" StartWidth="0.1" EndWidth="0.1" |
Location="OverCenter" Background="Yellow" BorderBrush="Yellow" Opacity="0.8"/> |
<telerik:RadialRange Name="Red" Min="{Binding YellowZoneEnd}" Max="100" StartWidth="0.1" EndWidth="0.1" |
Location="OverCenter" Background="Red" BorderBrush="Red" Opacity="0.8"/> |
</telerik:RangeList> |
<telerik:IndicatorList> |
<telerik:Needle Opacity="0.8" Name="needle"/> |
</telerik:IndicatorList> |
</telerik:RadialScale> |
</telerik:RadialGauge> |
</Grid> |
</telerik:RadGauge> |
</UserControl> |
namespace WMITest |
{ |
/// <summary> |
/// Interaction logic for PercentUtilizationGauge.xaml |
/// </summary> |
public partial class PercentUtilizationGauge : UserControl |
{ |
public uint Value { get; set; } |
public GaugeSettings Settings; |
public PercentUtilizationGauge() |
{ |
if (Settings == null) |
{ |
Settings = new GaugeSettings(); |
} |
InitializeComponent(); |
Settings.GreenZoneEnd = 60; |
} |
} |
public class GaugeSettings : INotifyPropertyChanged |
{ |
private uint greenZoneEnd = 40; |
public uint GreenZoneEnd |
{ |
get |
{ |
return greenZoneEnd; |
} |
set |
{ |
greenZoneEnd = value; |
OnPropertyChanged("GreenZoneEnd"); |
} |
} |
private uint yellowZoneEnd = 80; |
public uint YellowZoneEnd |
{ |
get |
{ |
return yellowZoneEnd; |
} |
set |
{ |
yellowZoneEnd = value; |
OnPropertyChanged("YellowZoneEnd"); |
} |
} |
#region INotifyCollectionChanged Members |
public event PropertyChangedEventHandler PropertyChanged; |
protected void OnPropertyChanged(string name) |
{ |
PropertyChangedEventHandler handler = PropertyChanged; |
if (handler != null) |
{ |
handler(this, new PropertyChangedEventArgs(name)); |
} |
} |
#endregion |
} |
} |
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
Additional information: Sequence contains no matching element
<telerik:RadTransitionControl x:Name="transitionRight" Grid.RowSpan="3" Grid.Column ="1" >
<telerik:RadTransitionControl.Transition >
<effects:SlideAndZoomTransition SlideDirection ="RightToLeft"/>
</telerik:RadTransitionControl.Transition >
</telerik:RadTransitionControl >
Format Code Block(
<
UserControl x:Class="AOS.UI.Windows.Controls.Widget.acWidgets"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:VMCommanding="clr-namespace:VMCommanding"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:vm="clr-namespace:AOS.UI.Windows.Controls.Widget.ViewModel"
Height="300" Width="300"
xmlns:Core="clr-namespace:AOS.UI.Windows.Controls.Core;assembly=AOS.UI.Windows.Controls.Core"
VMCommanding:CommandSinkBinding.CommandSink="{Binding}">
<UserControl.CommandBindings>
<VMCommanding:CommandSinkBinding Command="vm:WidgetViewModel.NavigateItemCommand" />
</UserControl.CommandBindings>
<UserControl.Resources>
<HierarchicalDataTemplate x:Key="NavigationTemplate"
ItemsSource="{Binding Path=WidgetList}">
<Grid Margin="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="16" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding Path=Icon_Name}"></Image>
<Core:CommandTextBlock Grid.Column="1" Margin="1"
Text="{Binding Path=Description}"
Command="vm:WidgetViewModel.NavigateItemCommand"
CommandParameter="{Binding}"/>
</Grid>
</HierarchicalDataTemplate>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="55" />
<RowDefinition Height="*" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<telerik:RadTreeView Grid.Row="2" ItemsSource="{Binding WidgetList}" ItemTemplate="{StaticResource NavigationTemplate}" />
</Grid>
</
UserControl>
)