uwp-demos/SfCellGrid/Tutorials/CellTemplate.xaml

76 строки
3.5 KiB
XML

<Layout:SampleLayout x:Class="CellGridSamples.CellTemplate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Layout="using:Common"
xmlns:cellGrid="using:Syncfusion.UI.Xaml.CellGrid"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="grid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<cellGrid:SfCellGrid x:Name="cellGrid">
<cellGrid:SfCellGrid.Resources>
<DataTemplate x:Key="Textboxtemplate">
<Border HorizontalAlignment="Center"
BorderBrush="LightGray"
BorderThickness="1.5"
CornerRadius="5">
<TextBox Width="130"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="LightYellow"
Foreground="LightSlateGray"
Text="{Binding CellValue}" />
</Border>
</DataTemplate>
<DataTemplate x:Key="SliderTemplate">
<Border HorizontalAlignment="Center"
BorderBrush="LightGray"
BorderThickness="1.5">
<Slider Name="mcSlider"
Width="300"
Height="25"
Background="Transparent"
Maximum="100"
Minimum="0"
Value="{Binding CellValue}" />
</Border>
</DataTemplate>
<DataTemplate x:Key="TextTemplate">
<Border BorderBrush="LightSlateGray"
BorderThickness="2"
CornerRadius="2">
<TextBlock Text="{Binding CellValue}" />
</Border>
</DataTemplate>
<DataTemplate x:Key="ImageTemplate">
<Image x:Name="Image"
Height="22"
Source="{Binding CellValue}" />
</DataTemplate>
<DataTemplate x:Key="ProgressbarTemplate">
<ProgressBar x:Name="progressBar"
Width="150"
Height="45"
Background="Transparent"
BorderThickness="0"
Maximum="20"
Minimum="0"
Value="{Binding Path=CellValue}">
<ProgressBar.Foreground>
<LinearGradientBrush StartPoint="0,0" EndPoint="0.7,1">
<GradientStop Offset="0" Color="#54BD31" />
<GradientStop Offset="1" Color="#149ED4" />
</LinearGradientBrush>
</ProgressBar.Foreground>
</ProgressBar>
</DataTemplate>
</cellGrid:SfCellGrid.Resources>
</cellGrid:SfCellGrid>
</Grid>
</Layout:SampleLayout>