зеркало из https://github.com/telerik/xaml-sdk.git
Weekly examples update
This commit is contained in:
Родитель
6ad5bc25bd
Коммит
19ecb6e97c
|
@ -1,260 +0,0 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
|
||||
xmlns:telerikChartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
|
||||
xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
|
||||
xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
|
||||
|
||||
<SolidColorBrush x:Key="SliderElement" Color="#FFC2C2C2"/>
|
||||
<SolidColorBrush x:Key="SliderElement_MouseOver" Color="#FFA3A3A3"/>
|
||||
<SolidColorBrush x:Key="SliderElement_Pressed" Color="#FF858585"/>
|
||||
<ControlTemplate x:Key="HandleRepeatButtonTemplate" TargetType="RepeatButton">
|
||||
<Grid x:Name="Root">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="MouseOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SliderElement_MouseOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SliderElement_Pressed}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
<Path
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
x:Name="Path"
|
||||
Stretch="Fill"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Width="4"
|
||||
Height="7"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Data="M3,0 L4,0 L4,1 L4,2 L4,3 L4,4 L4,5 L4,6 L4,7 L3,7 L3,6 L2,6 L2,5 L1,5 L1,4 L0,4 L0,3 L1,3 L1,2 L2,2 L2,1 L3,1 z"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
<Style x:Key="DecreaseHandleStyle" TargetType="RepeatButton">
|
||||
<Setter Property="Foreground" Value="{StaticResource SliderElement}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Width" Value="10"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="IsTabStop" Value="True"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Template" Value="{StaticResource HandleRepeatButtonTemplate}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
<Style x:Key="IncreaseHandleStyle" TargetType="RepeatButton" BasedOn="{StaticResource DecreaseHandleStyle}">
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<ScaleTransform ScaleX="-1" ScaleY="1"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="ThumbStyle" TargetType="Thumb">
|
||||
<Setter Property="Width" Value="8"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="IsTabStop" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Setter Property="BorderBrush" Value="#FFC2C2C2"/>
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Grid>
|
||||
<telerik:CommandManager.InputBindings>
|
||||
<telerik:InputBindingCollection>
|
||||
<telerik:MouseBinding Gesture="LeftDoubleClick" Command="telerikChartView:PanZoomBarCommands.ExpandSelectionToMinimum"/>
|
||||
</telerik:InputBindingCollection>
|
||||
</telerik:CommandManager.InputBindings>
|
||||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="AlternateThumbStyle" TargetType="Thumb" BasedOn="{StaticResource ThumbStyle}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Grid>
|
||||
<telerik:CommandManager.InputBindings>
|
||||
<telerik:InputBindingCollection>
|
||||
<telerik:MouseBinding Gesture="LeftDoubleClick" Command="telerikChartView:PanZoomBarCommands.ExpandSelectionToMaximum"/>
|
||||
</telerik:InputBindingCollection>
|
||||
</telerik:CommandManager.InputBindings>
|
||||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="SelectionMiddleThumbStyle" TargetType="Thumb">
|
||||
<Setter Property="IsTabStop" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Background" Value="#FFC2C2C2"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Grid>
|
||||
<telerik:CommandManager.InputBindings>
|
||||
<telerik:InputBindingCollection>
|
||||
<telerik:MouseBinding Gesture="LeftDoubleClick" Command="telerikChartView:PanZoomBarCommands.ExpandSelection"/>
|
||||
</telerik:InputBindingCollection>
|
||||
</telerik:CommandManager.InputBindings>
|
||||
<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="TrackStyle" TargetType="ContentControl">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="LargeHandleStyle" TargetType="RepeatButton">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RepeatButton">
|
||||
<Grid Background="Transparent"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="PanZoomBarStyle" TargetType="telerikControls:RadSlider">
|
||||
<Setter Property="HandlesVisibility" Value="Visible"/>
|
||||
<Setter Property="IsMouseWheelEnabled" Value="False"/>
|
||||
<Setter Property="IsSelectionRangeEnabled" Value="True"/>
|
||||
<Setter Property="StepAction" Value="MoveRange"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="ThumbStyle" Value="{StaticResource ThumbStyle}"/>
|
||||
<Setter Property="AlternateThumbStyle" Value="{StaticResource AlternateThumbStyle}"/>
|
||||
<Setter Property="SelectionMiddleThumbStyle" Value="{StaticResource SelectionMiddleThumbStyle}"/>
|
||||
<Setter Property="TrackStyle" Value="{StaticResource TrackStyle}"/>
|
||||
<Setter Property="IncreaseHandleStyle" Value="{StaticResource IncreaseHandleStyle}"/>
|
||||
<Setter Property="DecreaseHandleStyle" Value="{StaticResource DecreaseHandleStyle}"/>
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="SmallChange" Value="0.01"/>
|
||||
<Setter Property="LargeChange" Value="0.1"/>
|
||||
<Setter Property="Minimum" Value="0"/>
|
||||
<Setter Property="Maximum" Value="1"/>
|
||||
<Setter Property="MinimumRangeSpan" Value="0.01"/>
|
||||
<Setter Property="Padding" Value="0 3"/>
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="telerikControls:RadSlider">
|
||||
<telerikPrimitives:LayoutTransformControl x:Name="layoutControl" RenderTransformOrigin=".5 0">
|
||||
<telerikPrimitives:LayoutTransformControl.LayoutTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</telerikPrimitives:LayoutTransformControl.LayoutTransform>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="OrientationStates">
|
||||
<VisualState x:Name="Horizontal">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutControl" Storyboard.TargetProperty="LayoutTransform">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<RotateTransform Angle="0"/>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Vertical">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutControl" Storyboard.TargetProperty="LayoutTransform">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<RotateTransform Angle="-90"/>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RangeStartThumb" Storyboard.TargetProperty="(FrameworkElement.Cursor)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Cursor>SizeNS</Cursor>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RangeEndThumb" Storyboard.TargetProperty="(FrameworkElement.Cursor)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Cursor>SizeNS</Cursor>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
<Grid UseLayoutRounding="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentControl x:Name="Track" Grid.Column="1" Grid.ColumnSpan="3" Style="{TemplateBinding TrackStyle}"/>
|
||||
<RepeatButton x:Name="DecreaseButton"
|
||||
Delay="{TemplateBinding Delay}"
|
||||
Interval="{TemplateBinding RepeatInterval}"
|
||||
Visibility="{TemplateBinding HandlesVisibility}"
|
||||
Style="{TemplateBinding DecreaseHandleStyle}"/>
|
||||
<RepeatButton x:Name="LargeDecreaseButton" Grid.Column="1" Style="{StaticResource LargeHandleStyle}" Delay="{TemplateBinding Delay}" Interval="{TemplateBinding RepeatInterval}"/>
|
||||
<Grid Grid.Column="2" Margin="{TemplateBinding Padding}">
|
||||
<Thumb x:Name="SingleThumbHost" Style="{TemplateBinding ThumbStyle}" Visibility="Collapsed"/>
|
||||
<StackPanel x:Name="RangeThumbsPanel" Orientation="Horizontal">
|
||||
<Thumb x:Name="RangeStartThumb" Style="{TemplateBinding ThumbStyle}" Cursor="SizeWE" Visibility="{TemplateBinding ThumbVisibility}"/>
|
||||
<Thumb x:Name="RangeMiddleThumb" Style="{TemplateBinding SelectionMiddleThumbStyle}"/>
|
||||
<Thumb x:Name="RangeEndThumb" Style="{TemplateBinding AlternateThumbStyle}" Cursor="SizeWE" Visibility="{TemplateBinding ThumbVisibility}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<RepeatButton x:Name="LargeIncreaseButton" Grid.Column="3" Style="{StaticResource LargeHandleStyle}" Delay="{TemplateBinding Delay}" Interval="{TemplateBinding RepeatInterval}"/>
|
||||
<RepeatButton x:Name="IncreaseButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="4"
|
||||
Delay="{TemplateBinding Delay}"
|
||||
Interval="{TemplateBinding RepeatInterval}"
|
||||
Visibility="{TemplateBinding HandlesVisibility}"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Style="{TemplateBinding IncreaseHandleStyle}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</telerikPrimitives:LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -1,10 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace SeriesProvider
|
||||
{
|
||||
public class MyDataObject
|
||||
{
|
||||
public string Category { get; set; }
|
||||
public double Value { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SeriesProvider
|
||||
{
|
||||
public class MyViewModel
|
||||
{
|
||||
public ObservableCollection<SeriesProviderDataItem> Data
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public MyViewModel()
|
||||
{
|
||||
this.Data = new ObservableCollection<SeriesProviderDataItem>() {
|
||||
new SeriesProviderDataItem() { Items = new ObservableCollection<MyDataObject>() {
|
||||
new MyDataObject() { Category = "A", Value = 5},
|
||||
new MyDataObject() { Category = "B", Value = 7},
|
||||
new MyDataObject() { Category = "C", Value = 6},
|
||||
new MyDataObject() { Category = "D", Value = 8}
|
||||
}
|
||||
},
|
||||
new SeriesProviderDataItem() { Items = new ObservableCollection<MyDataObject>() {
|
||||
new MyDataObject() { Category = "A", Value = 15},
|
||||
new MyDataObject() { Category = "B", Value = 18},
|
||||
new MyDataObject() { Category = "C", Value = 19},
|
||||
new MyDataObject() { Category = "D", Value = 23}
|
||||
}
|
||||
},
|
||||
new SeriesProviderDataItem() { Items = new ObservableCollection<MyDataObject>() {
|
||||
new MyDataObject() { Category = "A", Value = 21},
|
||||
new MyDataObject() { Category = "B", Value = 25},
|
||||
new MyDataObject() { Category = "C", Value = 26},
|
||||
new MyDataObject() { Category = "D", Value = 25}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace SeriesProvider
|
||||
{
|
||||
public class SeriesProviderDataItem
|
||||
{
|
||||
public ObservableCollection<MyDataObject> Items { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,252 +0,0 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
|
||||
xmlns:telerikChartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
|
||||
xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
|
||||
xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart">
|
||||
|
||||
<SolidColorBrush x:Key="SliderElement" Color="#FFC2C2C2"/>
|
||||
<SolidColorBrush x:Key="SliderElement_MouseOver" Color="#FFA3A3A3"/>
|
||||
<SolidColorBrush x:Key="SliderElement_Pressed" Color="#FF858585"/>
|
||||
<ControlTemplate x:Key="HandleRepeatButtonTemplate" TargetType="RepeatButton">
|
||||
<Grid x:Name="Root">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="MouseOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SliderElement_MouseOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SliderElement_Pressed}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
<Path
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
x:Name="Path"
|
||||
Stretch="Fill"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Width="4"
|
||||
Height="7"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Data="M3,0 L4,0 L4,1 L4,2 L4,3 L4,4 L4,5 L4,6 L4,7 L3,7 L3,6 L2,6 L2,5 L1,5 L1,4 L0,4 L0,3 L1,3 L1,2 L2,2 L2,1 L3,1 z"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
<Style x:Key="DecreaseHandleStyle" TargetType="RepeatButton">
|
||||
<Setter Property="Foreground" Value="{StaticResource SliderElement}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Width" Value="10"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="IsTabStop" Value="True"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Template" Value="{StaticResource HandleRepeatButtonTemplate}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
<Style x:Key="IncreaseHandleStyle" TargetType="RepeatButton" BasedOn="{StaticResource DecreaseHandleStyle}">
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<ScaleTransform ScaleX="-1" ScaleY="1"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="ThumbStyle" TargetType="Thumb">
|
||||
<Setter Property="Width" Value="8"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="IsTabStop" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Setter Property="BorderBrush" Value="#FFC2C2C2"/>
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Grid>
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{x:Static telerikChartView:PanZoomBarCommands.ExpandSelectionToMinimum}"/>
|
||||
</Grid.InputBindings>
|
||||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="AlternateThumbStyle" TargetType="Thumb" BasedOn="{StaticResource ThumbStyle}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Grid>
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{x:Static telerikChartView:PanZoomBarCommands.ExpandSelectionToMaximum}"/>
|
||||
</Grid.InputBindings>
|
||||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="SelectionMiddleThumbStyle" TargetType="Thumb">
|
||||
<Setter Property="IsTabStop" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Background" Value="#FFC2C2C2"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Grid>
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{x:Static telerikChartView:PanZoomBarCommands.ExpandSelection}"/>
|
||||
</Grid.InputBindings>
|
||||
<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="TrackStyle" TargetType="ContentControl">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="LargeHandleStyle" TargetType="RepeatButton">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RepeatButton">
|
||||
<Grid Background="Transparent"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="PanZoomBarStyle" TargetType="telerikControls:RadSlider">
|
||||
<Setter Property="HandlesVisibility" Value="Visible"/>
|
||||
<Setter Property="IsMouseWheelEnabled" Value="False"/>
|
||||
<Setter Property="IsSelectionRangeEnabled" Value="True"/>
|
||||
<Setter Property="StepAction" Value="MoveRange"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="ThumbStyle" Value="{StaticResource ThumbStyle}"/>
|
||||
<Setter Property="AlternateThumbStyle" Value="{StaticResource AlternateThumbStyle}"/>
|
||||
<Setter Property="SelectionMiddleThumbStyle" Value="{StaticResource SelectionMiddleThumbStyle}"/>
|
||||
<Setter Property="TrackStyle" Value="{StaticResource TrackStyle}"/>
|
||||
<Setter Property="IncreaseHandleStyle" Value="{StaticResource IncreaseHandleStyle}"/>
|
||||
<Setter Property="DecreaseHandleStyle" Value="{StaticResource DecreaseHandleStyle}"/>
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="SmallChange" Value="0.01"/>
|
||||
<Setter Property="LargeChange" Value="0.1"/>
|
||||
<Setter Property="Minimum" Value="0"/>
|
||||
<Setter Property="Maximum" Value="1"/>
|
||||
<Setter Property="MinimumRangeSpan" Value="0.01"/>
|
||||
<Setter Property="Padding" Value="0 3"/>
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="telerikControls:RadSlider">
|
||||
<telerikPrimitives:LayoutTransformControl x:Name="layoutControl" RenderTransformOrigin=".5 0">
|
||||
<telerikPrimitives:LayoutTransformControl.LayoutTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</telerikPrimitives:LayoutTransformControl.LayoutTransform>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="OrientationStates">
|
||||
<VisualState x:Name="Horizontal">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutControl" Storyboard.TargetProperty="LayoutTransform">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<RotateTransform Angle="0"/>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Vertical">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutControl" Storyboard.TargetProperty="LayoutTransform">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<RotateTransform Angle="-90"/>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RangeStartThumb" Storyboard.TargetProperty="(FrameworkElement.Cursor)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Cursor>SizeNS</Cursor>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RangeEndThumb" Storyboard.TargetProperty="(FrameworkElement.Cursor)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Cursor>SizeNS</Cursor>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
||||
<Grid UseLayoutRounding="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentControl x:Name="Track" Grid.Column="1" Grid.ColumnSpan="3" Style="{TemplateBinding TrackStyle}"/>
|
||||
<RepeatButton x:Name="DecreaseButton"
|
||||
Delay="{TemplateBinding Delay}"
|
||||
Interval="{TemplateBinding RepeatInterval}"
|
||||
Visibility="{TemplateBinding HandlesVisibility}"
|
||||
Style="{TemplateBinding DecreaseHandleStyle}"/>
|
||||
<RepeatButton x:Name="LargeDecreaseButton" Grid.Column="1" Style="{StaticResource LargeHandleStyle}" Delay="{TemplateBinding Delay}" Interval="{TemplateBinding RepeatInterval}"/>
|
||||
<Grid Grid.Column="2" Margin="{TemplateBinding Padding}">
|
||||
<Thumb x:Name="SingleThumbHost" Style="{TemplateBinding ThumbStyle}" Visibility="Collapsed"/>
|
||||
<StackPanel x:Name="RangeThumbsPanel" Orientation="Horizontal">
|
||||
<Thumb x:Name="RangeStartThumb" Style="{TemplateBinding ThumbStyle}" Cursor="SizeWE" Visibility="{TemplateBinding ThumbVisibility}"/>
|
||||
<Thumb x:Name="RangeMiddleThumb" Style="{TemplateBinding SelectionMiddleThumbStyle}"/>
|
||||
<Thumb x:Name="RangeEndThumb" Style="{TemplateBinding AlternateThumbStyle}" Cursor="SizeWE" Visibility="{TemplateBinding ThumbVisibility}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<RepeatButton x:Name="LargeIncreaseButton" Grid.Column="3" Style="{StaticResource LargeHandleStyle}" Delay="{TemplateBinding Delay}" Interval="{TemplateBinding RepeatInterval}"/>
|
||||
<RepeatButton x:Name="IncreaseButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="4"
|
||||
Delay="{TemplateBinding Delay}"
|
||||
Interval="{TemplateBinding RepeatInterval}"
|
||||
Visibility="{TemplateBinding HandlesVisibility}"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Style="{TemplateBinding IncreaseHandleStyle}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</telerikPrimitives:LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -1,10 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace SeriesProvider
|
||||
{
|
||||
public class MyDataObject
|
||||
{
|
||||
public string Category { get; set; }
|
||||
public double Value { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SeriesProvider
|
||||
{
|
||||
public class MyViewModel
|
||||
{
|
||||
public ObservableCollection<SeriesProviderDataItem> Data
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public MyViewModel()
|
||||
{
|
||||
this.Data = new ObservableCollection<SeriesProviderDataItem>() {
|
||||
new SeriesProviderDataItem() { Items = new ObservableCollection<MyDataObject>() {
|
||||
new MyDataObject() { Category = "A", Value = 5},
|
||||
new MyDataObject() { Category = "B", Value = 7},
|
||||
new MyDataObject() { Category = "C", Value = 6},
|
||||
new MyDataObject() { Category = "D", Value = 8}
|
||||
}
|
||||
},
|
||||
new SeriesProviderDataItem() { Items = new ObservableCollection<MyDataObject>() {
|
||||
new MyDataObject() { Category = "A", Value = 15},
|
||||
new MyDataObject() { Category = "B", Value = 18},
|
||||
new MyDataObject() { Category = "C", Value = 19},
|
||||
new MyDataObject() { Category = "D", Value = 23}
|
||||
}
|
||||
},
|
||||
new SeriesProviderDataItem() { Items = new ObservableCollection<MyDataObject>() {
|
||||
new MyDataObject() { Category = "A", Value = 21},
|
||||
new MyDataObject() { Category = "B", Value = 25},
|
||||
new MyDataObject() { Category = "C", Value = 26},
|
||||
new MyDataObject() { Category = "D", Value = 25}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace SeriesProvider
|
||||
{
|
||||
public class SeriesProviderDataItem
|
||||
{
|
||||
public ObservableCollection<MyDataObject> Items { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,2 +1,8 @@
|
|||
This example demonstrates how to customize the Style of the DateTimePicker in order to add a today button to the RadDateTimePicker control for
|
||||
Silverlight and WPF.
|
||||
Silverlight and WPF.
|
||||
|
||||
IMPORTANT:
|
||||
|
||||
With the release of Telerik UI for WPF Q1 2016 there is a built-in functionality for adding a Today button inside RadDateTimePicker:
|
||||
- For WPF here: http://docs.telerik.com/devtools/wpf/controls/raddatetimepicker/features/todaybutton
|
||||
- For Silverlight here: http://docs.telerik.com/devtools/silverlight/controls/raddatetimepicker/features/todaybutton
|
|
@ -1,15 +0,0 @@
|
|||
<Application x:Class="WpfApplication1.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/System.Windows.xaml" />
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.xaml" />
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.Input.xaml" />
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -1,15 +0,0 @@
|
|||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="CreateCustomDateTimePickerColumn.App"
|
||||
>
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/System.Windows.xaml"/>
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.xaml"/>
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
|
||||
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -1,91 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace CreateCustomDateTimePickerColumn
|
||||
{
|
||||
public class Club: INotifyPropertyChanged
|
||||
{
|
||||
private string name;
|
||||
private DateTime? established;
|
||||
private int stadiumCapacity;
|
||||
|
||||
public Club(string name, DateTime? established, int stadiumCapacity)
|
||||
{
|
||||
this.name = name;
|
||||
this.established = established;
|
||||
this.stadiumCapacity = stadiumCapacity;
|
||||
}
|
||||
|
||||
public String Name
|
||||
{
|
||||
get { return this.name; }
|
||||
set
|
||||
{
|
||||
if (this.name != value)
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged("Name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime? Established
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.established;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.established != value)
|
||||
{
|
||||
this.established = value;
|
||||
this.OnPropertyChanged("Established");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int StadiumCapacity
|
||||
{
|
||||
get { return this.stadiumCapacity; }
|
||||
set
|
||||
{
|
||||
if (this.stadiumCapacity != value)
|
||||
{
|
||||
this.stadiumCapacity = value;
|
||||
this.OnPropertyChanged("StadiumCapacity");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<Club> GetClubs()
|
||||
{
|
||||
ObservableCollection<Club> clubs = new ObservableCollection<Club>();
|
||||
clubs.Add(new Club("Liverpool", new DateTime(1892, 1, 1, 13, 35, 15), 45362));
|
||||
clubs.Add(new Club("Manchester Utd.", new DateTime(1878, 1, 1, 18, 45, 25), 76212));
|
||||
clubs.Add(new Club("Chelsea", new DateTime(1905, 1, 1, 23, 45, 35), 42055));
|
||||
clubs.Add(new Club("Arsenal", new DateTime(1886, 1, 1, 4, 55, 45), 60355));
|
||||
return clubs;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateCustomDateTimePickerColumn_SL", "CreateCustomDateTimePickerColumn_SL.csproj", "{208BC40B-B3EC-4143-9F27-274BAF638812}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{208BC40B-B3EC-4143-9F27-274BAF638812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{208BC40B-B3EC-4143-9F27-274BAF638812}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{208BC40B-B3EC-4143-9F27-274BAF638812}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{208BC40B-B3EC-4143-9F27-274BAF638812}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateCustomDateTimePickerColumn_WPF", "CreateCustomDateTimePickerColumn_WPF.csproj", "{FD36B95B-5EAE-4988-837E-975C0637B114}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FD36B95B-5EAE-4988-837E-975C0637B114}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FD36B95B-5EAE-4988-837E-975C0637B114}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FD36B95B-5EAE-4988-837E-975C0637B114}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FD36B95B-5EAE-4988-837E-975C0637B114}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,26 +0,0 @@
|
|||
<UserControl x:Class="CreateCustomDateTimePickerColumn.GenericDateTimePicker"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:CreateCustomDateTimePickerColumn"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
xmlns:WPF="WPF"
|
||||
mc:Ignorable="WPF">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<telerik:RadDatePicker x:Name="Calendar"
|
||||
WPF:SelectedValue="{Binding SelectedDateTime,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type local:GenericDateTimePicker}}}"
|
||||
SelectedValue="{Binding SelectedDateTime,
|
||||
RelativeSource={RelativeSource AncestorType=local:GenericDateTimePicker}, Mode=TwoWay}"/>
|
||||
<telerik:RadTimePicker x:Name="TimePicker"
|
||||
Grid.Column="1"
|
||||
WPF:SelectedValue="{Binding SelectedDateTime,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type local:GenericDateTimePicker}}}"
|
||||
SelectedValue="{Binding SelectedDateTime,
|
||||
RelativeSource={RelativeSource AncestorType=local:GenericDateTimePicker}, Mode=TwoWay}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -1,42 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CreateCustomDateTimePickerColumn
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for GenericDateTimePicker.xaml
|
||||
/// </summary>
|
||||
public partial class GenericDateTimePicker : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty SelectedDateTimeProperty =
|
||||
DependencyProperty.Register("SelectedDateTime", typeof(DateTime?), typeof(GenericDateTimePicker), new PropertyMetadata(null));
|
||||
|
||||
public GenericDateTimePicker()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public DateTime? SelectedDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime?)this.GetValue(SelectedDateTimeProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(SelectedDateTimeProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using Telerik.Windows.Controls;
|
||||
using Telerik.Windows.Controls.GridView;
|
||||
|
||||
namespace CreateCustomDateTimePickerColumn
|
||||
{
|
||||
public class GenericDateTimePickerColumn: GridViewBoundColumnBase
|
||||
{
|
||||
public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
|
||||
{
|
||||
this.BindingTarget = GenericDateTimePicker.SelectedDateTimeProperty;
|
||||
var picker = new GenericDateTimePicker();
|
||||
picker.SetBinding(this.BindingTarget, this.CreateValueBinding());
|
||||
return picker;
|
||||
}
|
||||
|
||||
private Binding CreateValueBinding()
|
||||
{
|
||||
var valueBinding = new Binding();
|
||||
|
||||
valueBinding.Mode = BindingMode.TwoWay;
|
||||
|
||||
valueBinding.NotifyOnValidationError = true;
|
||||
valueBinding.ValidatesOnExceptions = true;
|
||||
valueBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
|
||||
valueBinding.Path = new PropertyPath(this.DataMemberBinding.Path.Path);
|
||||
return valueBinding;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
<UserControl x:Class="CreateCustomDateTimePickerColumn.GenericDateTimePickerSL"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:CreateCustomDateTimePickerColumn"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="400">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<telerik:RadDatePicker x:Name="Calendar"
|
||||
SelectedValue="{Binding SelectedDateTime,
|
||||
RelativeSource={RelativeSource AncestorType=local:GenericDateTimePickerSL}}"
|
||||
SelectionChanged="Calendar_SelectionChanged" />
|
||||
<telerik:RadTimePicker x:Name="TimePicker"
|
||||
Grid.Column="1"
|
||||
SelectedValue="{Binding SelectedDateTime,
|
||||
RelativeSource={RelativeSource AncestorType=local:GenericDateTimePickerSL}}"
|
||||
SelectionChanged="TimePicker_SelectionChanged" />
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -1,55 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CreateCustomDateTimePickerColumn
|
||||
{
|
||||
public partial class GenericDateTimePickerSL : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty SelectedDateTimeProperty =
|
||||
DependencyProperty.Register("SelectedDateTime", typeof(DateTime?), typeof(GenericDateTimePickerSL), new PropertyMetadata(null));
|
||||
|
||||
public GenericDateTimePickerSL()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public DateTime? SelectedDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime?)this.GetValue(SelectedDateTimeProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(SelectedDateTimeProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void HandlePickersSelectionChanged()
|
||||
{
|
||||
if (this.Calendar.SelectedDate != null && this.TimePicker.SelectedTime != null)
|
||||
{
|
||||
this.SelectedDateTime = this.Calendar.SelectedDate + this.TimePicker.SelectedTime;
|
||||
}
|
||||
}
|
||||
|
||||
private void TimePicker_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
this.HandlePickersSelectionChanged();
|
||||
}
|
||||
|
||||
private void Calendar_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
this.HandlePickersSelectionChanged();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
<UserControl x:Class="CreateCustomDateTimePickerColumn.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:CreateCustomDateTimePickerColumn"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
|
||||
<Grid>
|
||||
<telerik:RadGridView Name="radGridView" AutoGenerateColumns="False">
|
||||
<telerik:RadGridView.Columns>
|
||||
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />
|
||||
<telerik:GridViewDataColumn DataFormatString="{}{0:N0}"
|
||||
DataMemberBinding="{Binding StadiumCapacity}"
|
||||
Header="Stadium" />
|
||||
<local:GenericDateTimePickerColumn DataMemberBinding="{Binding Established}"/>
|
||||
</telerik:RadGridView.Columns>
|
||||
</telerik:RadGridView>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -1,18 +0,0 @@
|
|||
<Window x:Class="WpfApplication1.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:CreateCustomDateTimePickerColumn"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
Title="MainWindow">
|
||||
<Grid>
|
||||
<telerik:RadGridView Name="radGridView" AutoGenerateColumns="False">
|
||||
<telerik:RadGridView.Columns>
|
||||
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />
|
||||
<telerik:GridViewDataColumn DataFormatString="{}{0:N0}"
|
||||
DataMemberBinding="{Binding StadiumCapacity}"
|
||||
Header="Stadium" />
|
||||
<local:GenericDateTimePickerColumn DataMemberBinding="{Binding Established}"/>
|
||||
</telerik:RadGridView.Columns>
|
||||
</telerik:RadGridView>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -1,12 +0,0 @@
|
|||
#Create Custom DateTimePicker Column#
|
||||
This example demonstrates how you can create a custom DateTimePickerColumn column bound to a specific property of the business object,
|
||||
as well a reusable custom DateTimePickerColumn bound to its SelectedDate property.
|
||||
|
||||
Additional information about creating a custom DateTimePickerColumn can be found in the following articles:
|
||||
WPF: http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/create-date-time-picker-column.html
|
||||
SL: http://docs.telerik.com/devtools/silverlight/controls/radgridview/columns/how-to/create-date-time-picker-column.html
|
||||
|
||||
WPF: http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/create-generic-date-time-picker-column
|
||||
SL: http://docs.telerik.com/devtools/silverlight/controls/radgridview/columns/how-to/create-generic-date-time-picker-column
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<Application x:Class="DeferredSearching.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace DeferredSearching
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
|
@ -5,11 +5,11 @@
|
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D6E6F756-D1B2-448C-BCDD-80BE0F46C5CA}</ProjectGuid>
|
||||
<ProjectGuid>{51CC34DB-1000-43EC-8385-14F2104C1C0D}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CreateCustomDateTimePickerColumn</RootNamespace>
|
||||
<AssemblyName>WpfApplication1</AssemblyName>
|
||||
<RootNamespace>DeferredSearching</RootNamespace>
|
||||
<AssemblyName>DeferredSearching</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
|
@ -84,19 +84,16 @@
|
|||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Controls.dll</HintPath>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.GridView">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Controls.GridView.dll</HintPath>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.GridView.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Data">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Themes.Office_Black">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Office_Black.dll</HintPath>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
|
@ -107,10 +104,6 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="GenericDateTimePicker.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -119,17 +112,14 @@
|
|||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Club.cs" />
|
||||
<Compile Include="GenericDateTimePicker.xaml.cs">
|
||||
<DependentUpon>GenericDateTimePicker.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GenericDateTimePickerColumn.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MyViewModel.cs" />
|
||||
<Compile Include="Player.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
|
@ -0,0 +1,29 @@
|
|||
<Window x:Class="DeferredSearching.MainWindow"
|
||||
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:my="clr-namespace:DeferredSearching"
|
||||
Title="MainWindow" Height="567" Width="500">
|
||||
<Window.Resources>
|
||||
<my:MyViewModel x:Key="MyViewModel"/>
|
||||
</Window.Resources>
|
||||
<Grid DataContext="{StaticResource MyViewModel}"
|
||||
Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<telerik:RadGridView Grid.Row="0"
|
||||
x:Name="playersGrid"
|
||||
ItemsSource="{Binding Players}"
|
||||
ShowSearchPanel="True"
|
||||
IsSearchingDeferred="{Binding ElementName=isSearchingDeferredCheckBox, Path=IsChecked, Mode=OneWay}"/>
|
||||
<StackPanel Grid.Row="1"
|
||||
Orientation="Horizontal"
|
||||
Margin="0 5">
|
||||
<CheckBox Name="isSearchingDeferredCheckBox"
|
||||
Content="IsSearchingDeferred"
|
||||
FontWeight="Bold"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using Telerik.Windows.Data;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Specialized;
|
||||
using Telerik.Windows.Controls.GridView;
|
||||
using Telerik.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using Telerik.Windows.Controls.Filtering.Editors;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace DeferredSearching
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
isSearchingDeferredCheckBox.IsChecked = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace DeferredSearching
|
||||
{
|
||||
public class MyViewModel
|
||||
{
|
||||
|
||||
private ObservableCollection<Player> players;
|
||||
|
||||
public ObservableCollection<Player> Players
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.players == null)
|
||||
{
|
||||
this.players = Player.GetPlayers();
|
||||
}
|
||||
|
||||
return this.players;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DeferredSearching
|
||||
{
|
||||
public class Player : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private string name;
|
||||
private int number;
|
||||
private string country;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return this.name; }
|
||||
set
|
||||
{
|
||||
if (value != this.name)
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged("Name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Number
|
||||
{
|
||||
get { return this.number; }
|
||||
set
|
||||
{
|
||||
if (value != this.number)
|
||||
{
|
||||
this.number = value;
|
||||
this.OnPropertyChanged("Number");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Country
|
||||
{
|
||||
get { return this.country; }
|
||||
set
|
||||
{
|
||||
if (value != this.country)
|
||||
{
|
||||
this.country = value;
|
||||
this.OnPropertyChanged("Country");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Player()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Player(string name, int number, string country)
|
||||
{
|
||||
this.name = name;
|
||||
this.number = number;
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
|
||||
public static ObservableCollection<Player> GetPlayers()
|
||||
{
|
||||
var players = new ObservableCollection<Player>();
|
||||
players.Add(new Player("Pepe Reina", 25, "Spain"));
|
||||
players.Add(new Player("Jamie Carragher", 23, "England"));
|
||||
players.Add(new Player("Steven Gerrard", 8, "England"));
|
||||
players.Add(new Player("Fernando Torres", 9, "Spain"));
|
||||
players.Add(new Player("Edwin van der Sar", 1, "Netherlands"));
|
||||
players.Add(new Player("Rio Ferdinand", 5, "England"));
|
||||
players.Add(new Player("Ryan Giggs", 11, "Wales"));
|
||||
players.Add(new Player("Wayne Rooney", 10, "England"));
|
||||
players.Add(new Player("Petr Čech", 1, "Czech Republic"));
|
||||
players.Add(new Player("John Terry", 26, "England"));
|
||||
players.Add(new Player("Frank Lampard", 8, "England"));
|
||||
players.Add(new Player("Nicolas Anelka", 39, "France"));
|
||||
players.Add(new Player("Manuel Almunia", 1, "Spain"));
|
||||
players.Add(new Player("Gaël Clichy", 22, "France"));
|
||||
players.Add(new Player("Cesc Fàbregas", 4, "Spain"));
|
||||
players.Add(new Player("Robin van Persie", 11, "Netherlands"));
|
||||
return players;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
|
|||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CreateCustomDateTimePickerColumn")]
|
||||
[assembly: AssemblyTitle("FilterAsYouTypeWithFilterRow")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Telerik")]
|
||||
[assembly: AssemblyProduct("CreateCustomDateTimePickerColumn")]
|
||||
[assembly: AssemblyProduct("FilterAsYouTypeWithFilterRow")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
|
@ -0,0 +1,4 @@
|
|||
#Deferred Searching#
|
||||
This example demonstrates how to implement deferred searching for your RadGridView.
|
||||
See also:
|
||||
WPF: http://docs.telerik.com/devtools/wpf/controls/radgridview/features/search-as-you-type#deferred-searching
|
|
@ -118,6 +118,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrintPreviewWithSpreadsheet
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportMultipleGridViewsToOneDocument_SL", "ExportMultipleGridViewsToOneDocument\ExportMultipleGridViewsToOneDocument_SL.csproj", "{3B0EE271-B455-4B8B-91E8-92338F5777F3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReusingControlPanelItems_SL", "ReusingControlPanelItems\ReusingControlPanelItems_SL.csproj", "{0CE38745-5E67-49D0-B377-CBDD749A1B81}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -689,6 +691,16 @@ Global
|
|||
{3B0EE271-B455-4B8B-91E8-92338F5777F3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{3B0EE271-B455-4B8B-91E8-92338F5777F3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{3B0EE271-B455-4B8B-91E8-92338F5777F3}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{0CE38745-5E67-49D0-B377-CBDD749A1B81}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -124,6 +124,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrintPreviewWithSpreadsheet
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportMultipleGridViewsToOneDocument_WPF", "ExportMultipleGridViewsToOneDocument\ExportMultipleGridViewsToOneDocument_WPF.csproj", "{EE87A6DB-4FBE-4C69-9993-4497B59438C4}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReusingControlPanelItems_WPF", "ReusingControlPanelItems\ReusingControlPanelItems_WPF.csproj", "{05F53909-80FB-478E-ABE2-F589651BEA5F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeferredSearching_WPF", "DeferredSearching\DeferredSearching_WPF.csproj", "{51CC34DB-1000-43EC-8385-14F2104C1C0D}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -725,6 +729,26 @@ Global
|
|||
{EE87A6DB-4FBE-4C69-9993-4497B59438C4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{EE87A6DB-4FBE-4C69-9993-4497B59438C4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{EE87A6DB-4FBE-4C69-9993-4497B59438C4}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{05F53909-80FB-478E-ABE2-F589651BEA5F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{51CC34DB-1000-43EC-8385-14F2104C1C0D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,8 @@
|
|||
<Application x:Class="ReusingControlPanelItems_WPF.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ReusingControlPanelItems_WPF
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="ReusingControlPanelItems_SL.App"
|
||||
>
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -10,7 +10,7 @@ using System.Windows.Media;
|
|||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CreateCustomDateTimePickerColumn
|
||||
namespace ReusingControlPanelItems_SL
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
|
@ -0,0 +1,123 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ReusingControlPanelItems
|
||||
{
|
||||
/// <summary>
|
||||
/// A football club.
|
||||
/// </summary>
|
||||
public class Club : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private string name;
|
||||
private DateTime established;
|
||||
private int stadiumCapacity;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return this.name; }
|
||||
set
|
||||
{
|
||||
if (value != this.name)
|
||||
{
|
||||
this.name = value;
|
||||
this.OnPropertyChanged("Name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime Established
|
||||
{
|
||||
get { return this.established; }
|
||||
set
|
||||
{
|
||||
if (value != this.established)
|
||||
{
|
||||
this.established = value;
|
||||
this.OnPropertyChanged("Established");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int StadiumCapacity
|
||||
{
|
||||
get { return this.stadiumCapacity; }
|
||||
set
|
||||
{
|
||||
if (value != this.stadiumCapacity)
|
||||
{
|
||||
this.stadiumCapacity = value;
|
||||
this.OnPropertyChanged("StadiumCapacity");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Club()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Club(string name, DateTime established, int stadiumCapacity)
|
||||
{
|
||||
this.name = name;
|
||||
this.established = established;
|
||||
this.stadiumCapacity = stadiumCapacity;
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
|
||||
public static ObservableCollection<Club> GetClubs()
|
||||
{
|
||||
ObservableCollection<Club> clubs = new ObservableCollection<Club>();
|
||||
Club club;
|
||||
|
||||
// Liverpool
|
||||
club = new Club("Liverpool", new DateTime(1892, 1, 1), 45362);
|
||||
clubs.Add(club);
|
||||
|
||||
// Manchester Utd.
|
||||
club = new Club("Manchester Utd.", new DateTime(1878, 1, 1), 76212);
|
||||
clubs.Add(club);
|
||||
|
||||
// Chelsea
|
||||
club = new Club("Chelsea", new DateTime(1905, 1, 1), 42055);
|
||||
clubs.Add(club);
|
||||
|
||||
// Arsenal
|
||||
club = new Club("Arsenal", new DateTime(1886, 1, 1), 60355);
|
||||
clubs.Add(club);
|
||||
|
||||
return clubs;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ReusingControlPanelItems
|
||||
{
|
||||
public class IdentityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
<UserControl x:Class="ReusingControlPanelItems_SL.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
xmlns:my="clr-namespace:ReusingControlPanelItems"
|
||||
mc:Ignorable="d" d:DesignHeight="700" d:DesignWidth="700">
|
||||
<UserControl.Resources>
|
||||
<my:MyViewModel x:Key="MyViewModel"/>
|
||||
<my:IdentityConverter x:Key="IdentityConverter"/>
|
||||
|
||||
<Style TargetType="telerik:RadGridView">
|
||||
<Setter Property="ControlPanelItems">
|
||||
<Setter.Value>
|
||||
<telerik:ControlPanelItemCollection>
|
||||
<telerik:ControlPanelItem ButtonTooltip="Filtering Options" >
|
||||
<telerik:ControlPanelItem.ButtonContentTemplate>
|
||||
<DataTemplate>
|
||||
<Path Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="F1M511.6665,467.2715C509.6575,468.2995,507.1905,467.5095,506.1635,465.5005C505.1325,463.4915,505.9265,461.0325,507.9355,460.0005C509.9445,458.9745,512.4095,459.7695,513.4375,461.7745C514.4695,463.7825,513.6775,466.2405,511.6665,467.2715 M518.5605,462.8565L517.8825,460.0155L515.3935,460.2825C515.1415,459.8585,514.8505,459.4725,514.5225,459.1275L515.4435,456.8975L512.9515,455.3645L511.3965,457.2925C510.8575,457.1515,510.3025,457.0815,509.7415,457.0775L508.7675,454.9135L505.9375,455.6715L506.2705,458.0665C505.8795,458.3075,505.5215,458.5835,505.2025,458.8835L503.0535,458.0005L501.5175,460.4875L503.3665,461.9795C503.2315,462.4865,503.1515,463.0135,503.1415,463.5435L501.0335,464.4175L501.7125,467.2605L504.0635,467.0085C504.3355,467.4795,504.6545,467.9065,505.0235,468.2815L504.1575,470.3765L506.6475,471.9095L508.1425,470.0605C508.6495,470.1855,509.1655,470.2555,509.6925,470.2615L510.5785,472.3905L513.4255,471.7135L513.1675,469.2965C513.6075,469.0285,514.0145,468.7215,514.3635,468.3765L516.5455,469.2745L518.0815,466.7855L516.1495,465.2305C516.2665,464.7565,516.3315,464.2705,516.3385,463.7805z" Stretch="Fill" Fill="{telerik:Windows8Resource ResourceKey=StrongBrush}"/>
|
||||
</DataTemplate>
|
||||
</telerik:ControlPanelItem.ButtonContentTemplate>
|
||||
<telerik:ControlPanelItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsFilteringAllowed,
|
||||
Mode=TwoWay,
|
||||
Converter={StaticResource IdentityConverter}}"
|
||||
Content="Allow Filtering"
|
||||
Margin="10"/>
|
||||
|
||||
</DataTemplate>
|
||||
</telerik:ControlPanelItem.ContentTemplate>
|
||||
</telerik:ControlPanelItem>
|
||||
|
||||
<telerik:ControlPanelItem ButtonTooltip="Column chooser" >
|
||||
<telerik:ControlPanelItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox ItemsSource="{Binding Columns}" BorderThickness="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Content="{Binding Header, Mode=OneWay}" IsChecked="{Binding IsVisible, Mode=TwoWay}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DataTemplate>
|
||||
</telerik:ControlPanelItem.ContentTemplate>
|
||||
</telerik:ControlPanelItem>
|
||||
</telerik:ControlPanelItemCollection>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
<Grid x:Name="LayoutRoot"
|
||||
Background="White"
|
||||
DataContext="{StaticResource MyViewModel}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<telerik:RadGridView Grid.Row="0"
|
||||
Name="clubsGrid"
|
||||
ItemsSource="{Binding FirstGridClubs}"/>
|
||||
|
||||
<telerik:RadGridView Grid.Row="1"
|
||||
ItemsSource="{Binding SecondGridClubs}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ReusingControlPanelItems_SL
|
||||
{
|
||||
public partial class MainPage : UserControl
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
<Window x:Class="ReusingControlPanelItems_WPF.MainWindow"
|
||||
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:my="clr-namespace:ReusingControlPanelItems"
|
||||
Title="MainWindow"
|
||||
Height="550"
|
||||
Width="525">
|
||||
<Window.Resources>
|
||||
<my:MyViewModel x:Key="MyViewModel"/>
|
||||
<my:IdentityConverter x:Key="IdentityConverter"/>
|
||||
|
||||
<Style TargetType="telerik:RadGridView">
|
||||
<Setter Property="ControlPanelItems">
|
||||
<Setter.Value>
|
||||
<telerik:ControlPanelItemCollection>
|
||||
<telerik:ControlPanelItem ButtonTooltip="Filtering Options" >
|
||||
<telerik:ControlPanelItem.ButtonContentTemplate>
|
||||
<DataTemplate>
|
||||
<Path Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="F1M511.6665,467.2715C509.6575,468.2995,507.1905,467.5095,506.1635,465.5005C505.1325,463.4915,505.9265,461.0325,507.9355,460.0005C509.9445,458.9745,512.4095,459.7695,513.4375,461.7745C514.4695,463.7825,513.6775,466.2405,511.6665,467.2715 M518.5605,462.8565L517.8825,460.0155L515.3935,460.2825C515.1415,459.8585,514.8505,459.4725,514.5225,459.1275L515.4435,456.8975L512.9515,455.3645L511.3965,457.2925C510.8575,457.1515,510.3025,457.0815,509.7415,457.0775L508.7675,454.9135L505.9375,455.6715L506.2705,458.0665C505.8795,458.3075,505.5215,458.5835,505.2025,458.8835L503.0535,458.0005L501.5175,460.4875L503.3665,461.9795C503.2315,462.4865,503.1515,463.0135,503.1415,463.5435L501.0335,464.4175L501.7125,467.2605L504.0635,467.0085C504.3355,467.4795,504.6545,467.9065,505.0235,468.2815L504.1575,470.3765L506.6475,471.9095L508.1425,470.0605C508.6495,470.1855,509.1655,470.2555,509.6925,470.2615L510.5785,472.3905L513.4255,471.7135L513.1675,469.2965C513.6075,469.0285,514.0145,468.7215,514.3635,468.3765L516.5455,469.2745L518.0815,466.7855L516.1495,465.2305C516.2665,464.7565,516.3315,464.2705,516.3385,463.7805z" Stretch="Fill" Fill="{telerik:Windows8Resource ResourceKey=StrongBrush}"/>
|
||||
</DataTemplate>
|
||||
</telerik:ControlPanelItem.ButtonContentTemplate>
|
||||
<telerik:ControlPanelItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsFilteringAllowed,
|
||||
Mode=TwoWay,
|
||||
Converter={StaticResource IdentityConverter}}"
|
||||
Content="Allow Filtering"
|
||||
Margin="10"/>
|
||||
|
||||
</DataTemplate>
|
||||
</telerik:ControlPanelItem.ContentTemplate>
|
||||
</telerik:ControlPanelItem>
|
||||
|
||||
<telerik:ControlPanelItem ButtonTooltip="Column chooser" >
|
||||
<telerik:ControlPanelItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox ItemsSource="{Binding Columns}" BorderThickness="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Content="{Binding Header, Mode=OneWay}" IsChecked="{Binding IsVisible, Mode=TwoWay}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DataTemplate>
|
||||
</telerik:ControlPanelItem.ContentTemplate>
|
||||
</telerik:ControlPanelItem>
|
||||
</telerik:ControlPanelItemCollection>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
<Grid x:Name="LayoutRoot"
|
||||
Background="White"
|
||||
DataContext="{StaticResource MyViewModel}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<telerik:RadGridView Grid.Row="0"
|
||||
Name="clubsGrid"
|
||||
ItemsSource="{Binding FirstGridClubs}"/>
|
||||
|
||||
<telerik:RadGridView Grid.Row="1"
|
||||
ItemsSource="{Binding SecondGridClubs}"/>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ReusingControlPanelItems_WPF
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace ReusingControlPanelItems
|
||||
{
|
||||
public class MyViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private ObservableCollection<Club> firstGridClubs;
|
||||
private ObservableCollection<Club> secondGridClubs;
|
||||
private object selectedItem;
|
||||
|
||||
public ObservableCollection<Club> FirstGridClubs
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.firstGridClubs == null)
|
||||
{
|
||||
this.firstGridClubs = Club.GetClubs();
|
||||
}
|
||||
|
||||
return this.firstGridClubs;
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<Club> SecondGridClubs
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.secondGridClubs == null)
|
||||
{
|
||||
this.secondGridClubs = Club.GetClubs();
|
||||
}
|
||||
|
||||
return this.secondGridClubs;
|
||||
}
|
||||
}
|
||||
|
||||
public object SelectedItem
|
||||
{
|
||||
get { return this.selectedItem; }
|
||||
set
|
||||
{
|
||||
if (value != this.selectedItem)
|
||||
{
|
||||
this.selectedItem = value;
|
||||
this.OnPropertyChanged("SelectedItem");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ControlPanel")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Telerik")]
|
||||
[assembly: AssemblyProduct("ControlPanel")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,4 @@
|
|||
This example demonstrates how you can add a common Style targeting the ControlPanel that all the RadGridView controls in the application will inherit.
|
||||
See also:
|
||||
WPF: http://docs.telerik.com/devtools/wpf/controls/radgridview/features/overview-controlpanel.html#reusing-control-panel-items
|
||||
SL: http://docs.telerik.com/devtools/silverlight/controls/radgridview/features/overview-controlpanel.html#reusing-control-panel-items
|
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0CE38745-5E67-49D0-B377-CBDD749A1B81}</ProjectGuid>
|
||||
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ReusingControlPanelItems_SL</RootNamespace>
|
||||
<AssemblyName>ReusingControlPanelItems_SL</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
|
||||
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
||||
<SilverlightApplication>true</SilverlightApplication>
|
||||
<SupportedCultures>
|
||||
</SupportedCultures>
|
||||
<XapOutputs>true</XapOutputs>
|
||||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
||||
<XapFilename>ReusingControlPanelItems_SL.xap</XapFilename>
|
||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
||||
<SilverlightAppEntry>ReusingControlPanelItems_SL.App</SilverlightAppEntry>
|
||||
<TestPageFileName>ControlPanel_SLTestPage.html</TestPageFileName>
|
||||
<CreateTestPage>true</CreateTestPage>
|
||||
<ValidateXaml>true</ValidateXaml>
|
||||
<EnableOutOfBrowser>false</EnableOutOfBrowser>
|
||||
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
|
||||
<UsePlatformExtensions>false</UsePlatformExtensions>
|
||||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
||||
<LinkedServerProject>
|
||||
</LinkedServerProject>
|
||||
|
||||
|
||||
|
||||
|
||||
</PropertyGroup>
|
||||
<!-- This property group is only here to support building this project using the
|
||||
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
|
||||
to set the TargetFrameworkVersion to v3.5 -->
|
||||
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Bin\Release</OutputPath>
|
||||
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="system" />
|
||||
<Reference Include="System.Core">
|
||||
<HintPath>$(TargetFrameworkDirectory)System.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Windows.Browser" />
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Data">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.GridView">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.GridView.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_SL.xaml.cs">
|
||||
<DependentUpon>App_SL.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Club.cs" />
|
||||
<Compile Include="IdentityConverter.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App_SL.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\AppManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
|
||||
<SilverlightProjectProperties />
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{05F53909-80FB-478E-ABE2-F589651BEA5F}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ReusingControlPanelItems_WPF</RootNamespace>
|
||||
<AssemblyName>ReusingControlPanelItems_WPF</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkProfile />
|
||||
|
||||
|
||||
|
||||
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Data">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.GridView">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.GridView.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Club.cs" />
|
||||
<Compile Include="IdentityConverter.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MyViewModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 4.5</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -51,11 +51,11 @@
|
|||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls, Version=2012.3.1017.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input, Version=2012.3.1017.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
||||
<LinkedServerProject>
|
||||
</LinkedServerProject>
|
||||
|
||||
|
||||
|
||||
|
||||
</PropertyGroup>
|
||||
<!-- This property group is only here to support building this project using the
|
||||
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
|
||||
|
@ -70,11 +74,11 @@
|
|||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Windows.Browser" />
|
||||
<Reference Include="Telerik.Windows.Controls, Version=2012.3.1017.1050, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input, Version=2012.3.1017.1050, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
||||
<LinkedServerProject>
|
||||
</LinkedServerProject>
|
||||
|
||||
|
||||
|
||||
|
||||
</PropertyGroup>
|
||||
<!-- This property group is only here to support building this project using the
|
||||
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
|
||||
|
|
|
@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicFormatString_SL", "D
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ValueToTextConverterSL", "ValueToTextConverter\ValueToTextConverterSL.csproj", "{21A6694F-123E-439B-8DDD-85441AD52E1D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinusKeyCustomizations_SL", "MinusKeyCustomizations\MinusKeyCustomizations_SL.csproj", "{C0F63D57-B45A-4218-B9D2-4068B0A417E6}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -32,6 +34,10 @@ Global
|
|||
{21A6694F-123E-439B-8DDD-85441AD52E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{21A6694F-123E-439B-8DDD-85441AD52E1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{21A6694F-123E-439B-8DDD-85441AD52E1D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C0F63D57-B45A-4218-B9D2-4068B0A417E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C0F63D57-B45A-4218-B9D2-4068B0A417E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C0F63D57-B45A-4218-B9D2-4068B0A417E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C0F63D57-B45A-4218-B9D2-4068B0A417E6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IpAddress_WPF", "IpAddress\
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ValueToTextConverter", "ValueToTextConverter\ValueToTextConverter.csproj", "{886328C2-922F-4517-8FAF-3F971F35AE8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinusKeyCustomizations_WPF", "MinusKeyCustomizations\MinusKeyCustomizations_WPF.csproj", "{4C534578-EFB5-488D-BC29-B809446C954D}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -38,6 +40,10 @@ Global
|
|||
{886328C2-922F-4517-8FAF-3F971F35AE8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{886328C2-922F-4517-8FAF-3F971F35AE8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{886328C2-922F-4517-8FAF-3F971F35AE8E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4C534578-EFB5-488D-BC29-B809446C954D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4C534578-EFB5-488D-BC29-B809446C954D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4C534578-EFB5-488D-BC29-B809446C954D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4C534578-EFB5-488D-BC29-B809446C954D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,8 @@
|
|||
<Application x:Class="MinusKeyCustomizations.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,8 @@
|
|||
using System.Windows;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="MinusKeyCustomizations.App_SL"
|
||||
>
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public partial class App_SL : Application
|
||||
{
|
||||
public App_SL()
|
||||
{
|
||||
this.Startup += this.Application_Startup;
|
||||
this.Exit += this.Application_Exit;
|
||||
this.UnhandledException += this.Application_UnhandledException;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
this.RootVisual = new MainPage();
|
||||
}
|
||||
|
||||
private void Application_Exit(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
|
||||
{
|
||||
// If the app is running outside of the debugger then report the exception using
|
||||
// the browser's exception mechanism. On IE this will display it a yellow alert
|
||||
// icon in the status bar and Firefox will display a script error.
|
||||
if (!System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
|
||||
// NOTE: This will allow the application to continue running after an exception has been thrown
|
||||
// but not handled.
|
||||
// For production applications this error handling should be replaced with something that will
|
||||
// report the error to the website and stop the application.
|
||||
e.Handled = true;
|
||||
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
|
||||
}
|
||||
}
|
||||
|
||||
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
|
||||
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
|
||||
|
||||
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
<UserControl x:Class="MinusKeyCustomizations.Example"
|
||||
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:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
|
||||
xmlns:local="clr-namespace:MinusKeyCustomizations"
|
||||
Height="600" Width="1200" >
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="1" VerticalAlignment="Center">
|
||||
<TextBlock Text="RadMaskedNumericInput:" FontWeight="Bold" FontSize="14"/>
|
||||
<TextBlock Text="( Press OemMinus / Subtract Key to enter negative sign on null value )" />
|
||||
</StackPanel>
|
||||
<telerik:RadMaskedNumericInput Grid.Row="1" Grid.Column="1" Mask="" FormatString="n2" Value="{x:Null}" Width="240" Height="30" HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||
maskedInput:MaskedInputExtensions.AllowMinusOnNullValue="{Binding IsChecked, ElementName=firstInputCheckBox}" x:Name="inputA"
|
||||
EmptyContent="click and press minus key"/>
|
||||
|
||||
<StackPanel Grid.Row="3" VerticalAlignment="Center">
|
||||
<TextBlock Text="Custom NumericInput:" FontWeight="Bold" FontSize="14"/>
|
||||
<TextBlock Text="( Select all and press OemMinus / Subtract key to remove the selection and enter new negative value )" Width="350" />
|
||||
</StackPanel>
|
||||
<local:NumericInputMinusClearsSelection Grid.Row="3" Grid.Column="1" Mask="" FormatString="n2" Value="123456" Width="240" Height="30" HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||
maskedInput:MaskedInputExtensions.AllowMinusOnNullValue="{Binding IsChecked, ElementName=secondInputCheckBox}" x:Name="inputB"/>
|
||||
|
||||
<StackPanel Grid.Row="5" VerticalAlignment="Center">
|
||||
<TextBlock Text="Custom NumericInput:" Grid.Row="5" FontWeight="Bold" FontSize="14"/>
|
||||
<TextBlock Text="( Backspace / Delete key removes the negative sign symbol )" />
|
||||
</StackPanel>
|
||||
<local:NumericInputMinusDeletable Grid.Row="5" Grid.Column="1" Mask="" FormatString="n2" Value="-567" Width="240" Height="30" HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||
maskedInput:MaskedInputExtensions.AllowMinusOnNullValue="{Binding IsChecked, ElementName=thirdInputCheckBox}" x:Name="inputC"/>
|
||||
|
||||
<CheckBox Content="AllowMinusOnNullValue" x:Name="firstInputCheckBox" IsChecked="True" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<CheckBox Content="AllowMinusOnNullValue" x:Name="secondInputCheckBox" IsChecked="True" Grid.Column="2" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<CheckBox Content="AllowMinusOnNullValue" x:Name="thirdInputCheckBox" IsChecked="True" Grid.Column="2" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Bottom" Width="240">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Text="Value: " />
|
||||
<TextBlock Text="{Binding Value, ElementName=inputA}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
|
||||
<TextBlock FontWeight="Bold" Text="Text: " />
|
||||
<TextBlock Text="{Binding Text, ElementName=inputA}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" VerticalAlignment="Bottom" Width="240">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Text="Value: " />
|
||||
<TextBlock Text="{Binding Value, ElementName=inputB}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
|
||||
<TextBlock FontWeight="Bold" Text="Text: " />
|
||||
<TextBlock Text="{Binding Text, ElementName=inputB}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="5" Grid.Column="1" VerticalAlignment="Bottom" Width="240">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Text="Value: " />
|
||||
<TextBlock Text="{Binding Value, ElementName=inputC}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
|
||||
<TextBlock FontWeight="Bold" Text="Text: " />
|
||||
<TextBlock Text="{Binding Text, ElementName=inputC}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,12 @@
|
|||
using System.Windows.Controls;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public partial class Example : UserControl
|
||||
{
|
||||
public Example()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<UserControl x:Class="MinusKeyCustomizations.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MinusKeyCustomizations"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="400">
|
||||
<Grid x:Name="LayoutRoot" Background="White">
|
||||
|
||||
<local:Example />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,12 @@
|
|||
using System.Windows.Controls;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public partial class MainPage : UserControl
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<Window x:Class="MinusKeyCustomizations.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:MinusKeyCustomizations"
|
||||
Title="Minus Key Customizations" Height="700" Width="1200">
|
||||
<Grid>
|
||||
<local:Example />
|
||||
</Grid>
|
||||
</Window>
|
|
@ -0,0 +1,12 @@
|
|||
using System.Windows;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{C0F63D57-B45A-4218-B9D2-4068B0A417E6}</ProjectGuid>
|
||||
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MinusKeyCustomizations</RootNamespace>
|
||||
<AssemblyName>MinusKeyCustomizations_SL</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
|
||||
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
||||
<SilverlightApplication>true</SilverlightApplication>
|
||||
<SupportedCultures>
|
||||
</SupportedCultures>
|
||||
<XapOutputs>true</XapOutputs>
|
||||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
||||
<XapFilename>MinusKeyCustomizations_SL.xap</XapFilename>
|
||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
||||
<SilverlightAppEntry>MinusKeyCustomizations.App_SL</SilverlightAppEntry>
|
||||
<TestPageFileName>MinusKeyCustomizations_SLTestPage.html</TestPageFileName>
|
||||
<CreateTestPage>true</CreateTestPage>
|
||||
<ValidateXaml>true</ValidateXaml>
|
||||
<EnableOutOfBrowser>false</EnableOutOfBrowser>
|
||||
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
|
||||
<UsePlatformExtensions>false</UsePlatformExtensions>
|
||||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
||||
<LinkedServerProject>
|
||||
</LinkedServerProject>
|
||||
|
||||
|
||||
|
||||
|
||||
</PropertyGroup>
|
||||
<!-- This property group is only here to support building this project using the
|
||||
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
|
||||
to set the TargetFrameworkVersion to v3.5 -->
|
||||
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Bin\Release</OutputPath>
|
||||
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="system" />
|
||||
<Reference Include="System.Core">
|
||||
<HintPath>$(TargetFrameworkDirectory)System.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Windows.Browser" />
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_SL.xaml.cs">
|
||||
<DependentUpon>App_SL.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Example.xaml.cs">
|
||||
<DependentUpon>Example.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NumericInputMinusClearsSelection.cs" />
|
||||
<Compile Include="NumericInputMinusDeletable.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App_SL.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Example.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\AppManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
|
||||
<SilverlightProjectProperties />
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
|
@ -0,0 +1,128 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{4C534578-EFB5-488D-BC29-B809446C954D}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MinusKeyCustomizations</RootNamespace>
|
||||
<AssemblyName>MinusKeyCustomizations_WPF</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
||||
|
||||
|
||||
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Example.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Example.xaml.cs">
|
||||
<DependentUpon>Example.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="NumericInputMinusClearsSelection.cs" />
|
||||
<Compile Include="NumericInputMinusDeletable.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Telerik.Windows.Controls;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public class NumericInputMinusClearsSelection : RadMaskedNumericInput
|
||||
{
|
||||
protected override bool HandleSubstractKey()
|
||||
{
|
||||
// Show Negative symnbol when all is selected.
|
||||
if (!string.IsNullOrEmpty(this.Text) && this.Text.Length == this.SelectionLength)
|
||||
{
|
||||
if (this.ClearCommand != null)
|
||||
{
|
||||
this.ClearCommand.Execute(null);
|
||||
}
|
||||
|
||||
this.ToggleNegativeSignKey();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.HandleSubstractKey();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using Telerik.Windows.Controls;
|
||||
|
||||
namespace MinusKeyCustomizations
|
||||
{
|
||||
public class NumericInputMinusDeletable : RadMaskedNumericInput
|
||||
{
|
||||
private TextBox innerTextBox = null;
|
||||
|
||||
public string TextInternal
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.innerTextBox == null ? null : this.innerTextBox.Text;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
this.innerTextBox = this.GetTemplateChild("EditorSite") as TextBox;
|
||||
}
|
||||
|
||||
protected override bool CanModifyChar(char character)
|
||||
{
|
||||
if (character.ToString() == this.NegativeSign.Token)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return base.CanModifyChar(character);
|
||||
}
|
||||
|
||||
protected override void HandleBackKeyNoMask()
|
||||
{
|
||||
this.TryClearAll();
|
||||
|
||||
int selectionStart = this.SelectionStart;
|
||||
base.HandleBackKeyNoMask();
|
||||
this.TryDeleteMinusSign(selectionStart);
|
||||
}
|
||||
|
||||
protected override void HandleDeleteKeyNoMask()
|
||||
{
|
||||
this.TryClearAll();
|
||||
|
||||
int selectionStart = this.SelectionStart;
|
||||
base.HandleDeleteKeyNoMask();
|
||||
this.TryDeleteMinusSign(selectionStart);
|
||||
}
|
||||
|
||||
private void TryDeleteMinusSign(int nextSelectionStart)
|
||||
{
|
||||
if (this.IsNegativeValue && !string.IsNullOrEmpty(this.TextInternal) && !this.TextInternal.Contains(this.NegativeSign.Token))
|
||||
{
|
||||
// Dispatcher makes so that Value is updated first, then the negativity change.
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
this.ToggleNegativeSignKey();
|
||||
this.SelectionStart = nextSelectionStart;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private void TryClearAll()
|
||||
{
|
||||
if (this.TextInternal.Length == this.SelectionLength && this.ClearCommand != null)
|
||||
{
|
||||
this.ClearCommand.Execute(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
>
|
||||
<Deployment.Parts>
|
||||
</Deployment.Parts>
|
||||
</Deployment>
|
|
@ -0,0 +1,44 @@
|
|||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MinusKeyCustomizations")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MinusKeyCustomizations")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MinusKeyCustomizations.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MinusKeyCustomizations.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MinusKeyCustomizations.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
|
@ -0,0 +1,7 @@
|
|||
MinusKeyCustomizations SDK sample shows how to use the negative sign symbol in custom, non- default way.
|
||||
Please note that although the code shows RadMaskedNumericInput and its custom subclasses, the same approach can be used for RadMaskedCurrencyInput.
|
||||
* The first control in the demo is RadMaskedNumericInput with AllowMinusOnNullValues set to true. This allows you to press OemMinus / Subtract key on the keyboard when the value is null resulting in entering negative sign symbol before entering any digits.
|
||||
|
||||
* The second control in the demo is custom RadMaskedNumericInput which allows you to select all and press OemMinus / Subtract key resulting in clearing the value and entering negative sign. This is achieved with overriding HandleSubtractkey method of RadMaskedNumericInput.
|
||||
|
||||
* The third control in the demo is custom RadMaskedNumericInput which allows you to delete the negative sign symbol with Backspace / Delete keys on the keyboard. This is achieved with overriding CanModifyChar, HandleBackKeyNoMask and HandleDeleteKeyNoMaks methods of the RadMaskedNumericInput.
|
|
@ -248,9 +248,10 @@ namespace CreateDocumentWithImages
|
|||
{
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
CompressedStream compressedStream = new CompressedStream(stream, StreamOperationMode.Write, new DeflateSettings());
|
||||
compressedStream.Write(data, 0, data.Length);
|
||||
compressedStream.Flush();
|
||||
using (CompressedStream compressedStream = new CompressedStream(stream, StreamOperationMode.Write, new DeflateSettings()))
|
||||
{
|
||||
compressedStream.Write(data, 0, data.Length);
|
||||
}
|
||||
|
||||
return stream.ToArray();
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
|
||||
namespace CreateDocumentWithImages.Resources
|
||||
{
|
||||
public class ResourceHelper
|
||||
{
|
||||
public static Uri GetResourceUri(string resource)
|
||||
{
|
||||
AssemblyName assemblyName = new AssemblyName(typeof(ResourceHelper).Assembly.FullName);
|
||||
string resourcePath = "/" + assemblyName.Name + ";component/" + resource;
|
||||
Uri resourceUri = new Uri(resourcePath, UriKind.Relative);
|
||||
|
||||
return resourceUri;
|
||||
}
|
||||
|
||||
public static Stream GetResourceStream(string resource)
|
||||
{
|
||||
return Application.GetResourceStream(ResourceHelper.GetResourceUri(resource)).Stream;
|
||||
}
|
||||
|
||||
public static byte[] GetResourceBytes(string resource)
|
||||
{
|
||||
MemoryStream memory = new MemoryStream();
|
||||
|
||||
using(Stream stream = GetResourceStream(resource))
|
||||
{
|
||||
stream.CopyTo(memory);
|
||||
}
|
||||
|
||||
return memory.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<Application x:Class="WpfApplication1.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,8 @@
|
|||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="SilverlightApplication1.App"
|
||||
>
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SilverlightApplication1
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
|
||||
public App()
|
||||
{
|
||||
this.Startup += this.Application_Startup;
|
||||
this.Exit += this.Application_Exit;
|
||||
this.UnhandledException += this.Application_UnhandledException;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
this.RootVisual = new MainPage();
|
||||
}
|
||||
|
||||
private void Application_Exit(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
|
||||
{
|
||||
// If the app is running outside of the debugger then report the exception using
|
||||
// the browser's exception mechanism. On IE this will display it a yellow alert
|
||||
// icon in the status bar and Firefox will display a script error.
|
||||
if (!System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
|
||||
// NOTE: This will allow the application to continue running after an exception has been thrown
|
||||
// but not handled.
|
||||
// For production applications this error handling should be replaced with something that will
|
||||
// report the error to the website and stop the application.
|
||||
e.Handled = true;
|
||||
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
|
||||
}
|
||||
}
|
||||
|
||||
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
|
||||
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
|
||||
|
||||
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,11 +5,11 @@
|
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{5EAB03FF-9DC1-4BE6-9E00-4CEC4225D765}</ProjectGuid>
|
||||
<ProjectGuid>{0C8BF2F1-6CAC-4E7E-969B-9B93C5C03D30}</ProjectGuid>
|
||||
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CreateCustomDateTimePickerColumn</RootNamespace>
|
||||
<RootNamespace>SilverlightApplication1</RootNamespace>
|
||||
<AssemblyName>SilverlightApplication1</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
||||
<XapFilename>SilverlightApplication1.xap</XapFilename>
|
||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
||||
<SilverlightAppEntry>CreateCustomDateTimePickerColumn.App</SilverlightAppEntry>
|
||||
<SilverlightAppEntry>SilverlightApplication1.App</SilverlightAppEntry>
|
||||
<TestPageFileName>SilverlightApplication1TestPage.html</TestPageFileName>
|
||||
<CreateTestPage>true</CreateTestPage>
|
||||
<ValidateXaml>true</ValidateXaml>
|
||||
|
@ -57,7 +57,7 @@
|
|||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Bin\Release</OutputPath>
|
||||
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
|
@ -73,35 +73,28 @@
|
|||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Windows.Browser" />
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries.NoXaml\Silverlight\Telerik.Windows.Controls.dll</HintPath>
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Data">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Data">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries.NoXaml\Silverlight\Telerik.Windows.Data.dll</HintPath>
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries.NoXaml\Silverlight\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.GridView">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries.NoXaml\Silverlight\Telerik.Windows.Controls.GridView.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Themes.Office_Black.dll">
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries.NoXaml\Silverlight\Telerik.Windows.Themes.Office_Black.dll</HintPath>
|
||||
<HintPath>$(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_SL.xaml.cs">
|
||||
<DependentUpon>App_SL.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Club.cs" />
|
||||
<Compile Include="GenericDateTimePicker.xaml.cs">
|
||||
<DependentUpon>GenericDateTimePicker.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GenericDateTimePickerColumn.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomString.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyViewModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -109,10 +102,6 @@
|
|||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="GenericDateTimePicker.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
|
@ -0,0 +1,161 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E6DFBAD5-275E-4111-9CF1-7863953B4D43}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WpfApplication1</RootNamespace>
|
||||
<AssemblyName>WpfApplication1</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
||||
|
||||
|
||||
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;WPF</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Data">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Controls.Input">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Telerik.Windows.Data">
|
||||
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomString.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MyViewModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WpfApplication1
|
||||
{
|
||||
public class CustomString : INotifyPropertyChanged
|
||||
{
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
string _value;
|
||||
|
||||
public CustomString()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CustomString(string value)
|
||||
{
|
||||
this._value = value;
|
||||
}
|
||||
|
||||
public static implicit operator string(CustomString s)
|
||||
{
|
||||
return s.ToString();
|
||||
}
|
||||
|
||||
public static implicit operator CustomString(string s)
|
||||
{
|
||||
return new CustomString(s);
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return this._value; }
|
||||
set
|
||||
{
|
||||
if (this._value != value)
|
||||
{
|
||||
this._value = value;
|
||||
this.OnPropertyChanged("Value");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return _value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<UserControl x:Class="SilverlightApplication1.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d"
|
||||
xmlns:my="clr-namespace:CollectionEditorCustomDataType"
|
||||
d:DesignHeight="300" d:DesignWidth="400">
|
||||
<UserControl.Resources>
|
||||
<my:MyViewModel x:Key="MyViewModel"/>
|
||||
</UserControl.Resources>
|
||||
<Grid DataContext="{StaticResource MyViewModel}" Name="grid">
|
||||
<telerik:CollectionEditor Source="{Binding Values}"
|
||||
Name="collectionEditor"
|
||||
Header="Name" >
|
||||
<telerik:CollectionEditor.Style>
|
||||
<Style TargetType="telerik:CollectionEditor">
|
||||
<Setter Property="ItemTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</telerik:CollectionEditor.Style>
|
||||
</telerik:CollectionEditor>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -1,16 +1,17 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using CreateCustomDateTimePickerColumn;
|
||||
using System.Windows.Input;
|
||||
using System.Windows;
|
||||
using Telerik.Windows.Controls;
|
||||
|
||||
namespace CreateCustomDateTimePickerColumn
|
||||
namespace SilverlightApplication1
|
||||
{
|
||||
public partial class MainPage : UserControl
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.radGridView.ItemsSource = Club.GetClubs();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<Window x:Class="WpfApplication1.MainWindow"
|
||||
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:my="clr-namespace:CollectionEditorCustomDataType"
|
||||
Title="MainWindow" Height="600" Width="700">
|
||||
<Window.Resources>
|
||||
<my:MyViewModel x:Key="MyViewModel"/>
|
||||
</Window.Resources>
|
||||
<Grid DataContext="{StaticResource MyViewModel}" Name="grid">
|
||||
<telerik:CollectionEditor Source="{Binding Values}"
|
||||
Name="collectionEditor"
|
||||
Header="Name" >
|
||||
<telerik:CollectionEditor.Style>
|
||||
<Style TargetType="telerik:CollectionEditor">
|
||||
<Setter Property="ItemTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</telerik:CollectionEditor.Style>
|
||||
</telerik:CollectionEditor>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -2,7 +2,9 @@
|
|||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using CreateCustomDateTimePickerColumn;
|
||||
using Telerik.Windows.Controls;
|
||||
using System.Windows.Controls;
|
||||
using CollectionEditorCustomDataType;
|
||||
|
||||
namespace WpfApplication1
|
||||
{
|
||||
|
@ -14,7 +16,6 @@ namespace WpfApplication1
|
|||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.radGridView.ItemsSource = Club.GetClubs();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using WpfApplication1;
|
||||
|
||||
namespace CollectionEditorCustomDataType
|
||||
{
|
||||
public class MyViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private ObservableCollection<CustomString> values;
|
||||
|
||||
public ObservableCollection<CustomString> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.values == null)
|
||||
{
|
||||
this.values = this.GenerateData();
|
||||
}
|
||||
|
||||
return this.values;
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<CustomString> GenerateData()
|
||||
{
|
||||
ObservableCollection<CustomString> data = new ObservableCollection<CustomString>();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
data.Add("Value " + i.ToString());
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
>
|
||||
<Deployment.Parts>
|
||||
</Deployment.Parts>
|
||||
</Deployment>
|
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CollectionEditorCustomDataType")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Telerik")]
|
||||
[assembly: AssemblyProduct("CollectionEditorCustomDataType")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c31a8e48-cf2e-47d9-89ef-b025822afeb3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,8 @@
|
|||
#CollectionEditor#
|
||||
This example demonstrates how to use CollectionEditor with custom data type. Built-in data types(as string, for example) does not have a default constructor,
|
||||
thus cannot be added to the Collection editor's source collection. This can be achieved by using a custom object and casting it
|
||||
to the one needed through an implicit operator.
|
||||
|
||||
See also:
|
||||
WPF: http://docs.telerik.com/devtools/wpf/controls/radpropertygrid/features/collectioneditor.html
|
||||
SL: http://docs.telerik.com/devtools/silverlight/controls/radpropertygrid/features/collectioneditor.html
|
|
@ -118,6 +118,7 @@
|
|||
<Compile Include="Functions\Arguments.cs" />
|
||||
<Compile Include="Functions\E.cs" />
|
||||
<Compile Include="Functions\GeoMean.cs" />
|
||||
<Compile Include="Functions\Indirect.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
<DependentUpon>App_WPF.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Functions\Indirect.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Telerik.Windows.Documents.Spreadsheet.Expressions;
|
||||
using Telerik.Windows.Documents.Spreadsheet.Expressions.Functions;
|
||||
using Telerik.Windows.Documents.Spreadsheet.Model;
|
||||
using Telerik.Windows.Documents.Spreadsheet.Utilities;
|
||||
|
||||
namespace CustomFunctions.Functions
|
||||
{
|
||||
public class Indirect : FunctionWithArguments
|
||||
{
|
||||
public static readonly string FunctionName = "INDIRECT";
|
||||
private static readonly FunctionInfo Info;
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return FunctionName;
|
||||
}
|
||||
}
|
||||
|
||||
public override FunctionInfo FunctionInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Info;
|
||||
}
|
||||
}
|
||||
|
||||
static Indirect()
|
||||
{
|
||||
string description = "Returns the reference of the cell specified by a text string.";
|
||||
|
||||
IEnumerable<ArgumentInfo> requiredArguments = new ArgumentInfo[]
|
||||
{
|
||||
new ArgumentInfo("Text",
|
||||
"A reference to a cell that contains an A1-style reference, a name defined as a reference, or a reference to a cell as a text string.",
|
||||
ArgumentType.Text),
|
||||
};
|
||||
|
||||
Info = new FunctionInfo(FunctionName,FunctionCategory.LookupReference, description, requiredArguments);
|
||||
}
|
||||
|
||||
protected override RadExpression EvaluateOverride(FunctionEvaluationContext<object> context)
|
||||
{
|
||||
string reference = context.Arguments[0].ToString();
|
||||
|
||||
if (string.IsNullOrEmpty(reference))
|
||||
{
|
||||
return ErrorExpressions.ReferenceError;
|
||||
}
|
||||
|
||||
List<CellReferenceRange> cellReferenceRanges = new List<CellReferenceRange>();
|
||||
|
||||
CellReferenceRangeExpression expression;
|
||||
if (NameConverter.TryConvertNamesToCellReferenceRangeExpression(reference, context.Worksheet, context.RowIndex, context.ColumnIndex, out expression))
|
||||
{
|
||||
cellReferenceRanges.AddRange(expression.CellReferenceRanges);
|
||||
}
|
||||
|
||||
if (cellReferenceRanges.Count == 1)
|
||||
{
|
||||
CellReferenceRange cellReferenceRange = cellReferenceRanges.First();
|
||||
if (cellReferenceRange.Worksheet == context.Worksheet)
|
||||
{
|
||||
CellRange cellRange = cellReferenceRange.ToCellRange();
|
||||
if (cellRange.Contains(context.RowIndex, context.ColumnIndex))
|
||||
{
|
||||
return ErrorExpressions.CyclicReference;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cellReferenceRanges.Count == 0)
|
||||
{
|
||||
return ErrorExpressions.ReferenceError;
|
||||
}
|
||||
|
||||
return expression;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -43,6 +43,7 @@ namespace CustomFunctions
|
|||
FunctionManager.RegisterFunction(new RepeatString());
|
||||
FunctionManager.RegisterFunction(new Nand());
|
||||
FunctionManager.RegisterFunction(new CustomFunctions.Functions.Upper());
|
||||
FunctionManager.RegisterFunction(new CustomFunctions.Functions.Indirect());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ This examples shows how to create and register custom functions in RadSpreadshee
|
|||
The example shows several functions inheriting from different members from RadSpreadsheet functions inheritance tree.
|
||||
- Arguments and E functions are inheriting from FunctionBase abstract class.
|
||||
- RepeatString function is inheriting from FunctionWithArguments abstract class.
|
||||
- Indirect function is inheriting from FunctionWithArguments abstract class and is overriding the definition of the default RadSpreadsheet "INDIRECT" function. It also demonstrates the usage of CellReferenceRangeExpression.
|
||||
- Add and GeoMean functions are inheriting from NumbersInFunction abstract class and are using their own ArgumentConversionRules.
|
||||
- Nand function is inheriting from BooleansInFunction abstract class.
|
||||
- Upper function is inheriting from StringsInFunction abstract class and is overriding the definition of the default RadSpreadsheet "UPPER" function.
|
||||
|
|
Двоичные данные
Spreadsheet/CustomFunctions/Resources/CustomFunctions.xlsx
Двоичные данные
Spreadsheet/CustomFunctions/Resources/CustomFunctions.xlsx
Двоичный файл не отображается.
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче