xaml-sdk/PersistenceFramework/NativeControls/MainWindow.xaml

136 строки
7.1 KiB
XML

<Window x:Class="NativeControls.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:NativeControls"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow"
Width="525"
Height="350"
WindowState="Maximized">
<Window.DataContext>
<local:MainViewModel />
</Window.DataContext>
<Grid x:Name="LayoutRoot" Background="White">
<Border BorderBrush="#abc1de" BorderThickness="1">
<StackPanel x:Name="layout" Margin="45 15 45 0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Margin="0 0 10 0">
<TextBlock Margin="0 0 0 5" Text="From:" />
<TextBox Width="150" />
</StackPanel>
<StackPanel Grid.Column="1" Margin="0 0 10 0">
<TextBlock Margin="0 0 0 5" Text="To:" />
<TextBox Width="150" />
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Margin="0 0 0 5" Text="Subject:" />
<TextBox Width="150" />
</StackPanel>
<StackPanel Grid.Row="1"
Grid.Column="0"
Margin="0 15">
<TextBlock Margin="0 0 0 5" Text="FontFamily" />
<telerik:RadComboBox x:Name="comboFontFamily"
Width="150"
HorizontalAlignment="Left"
SelectedIndex="0">
<telerik:RadComboBoxItem Content="Arial" />
<telerik:RadComboBoxItem Content="TimesNewRoman" />
<telerik:RadComboBoxItem Content="Verdana" />
<telerik:RadComboBoxItem Content="Comic Sans MS" />
</telerik:RadComboBox>
</StackPanel>
<StackPanel Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="0 15">
<TextBlock Margin="0 0 0 5" Text="FontSize" />
<StackPanel Orientation="Horizontal">
<telerik:RadComboBox x:Name="comboFontSize"
Width="60"
Margin="0 0 10 0"
SelectedIndex="1">
<telerik:RadComboBoxItem Content="11" />
<telerik:RadComboBoxItem Content="12" />
<telerik:RadComboBoxItem Content="16" />
<telerik:RadComboBoxItem Content="18" />
</telerik:RadComboBox>
<telerik:RadToggleButton x:Name="buttonBold"
Width="24"
Margin="0 0 2 0"
Checked="buttonBold_Click"
Content="B"
FontWeight="Bold"
Unchecked="buttonBold_Click" />
<telerik:RadToggleButton x:Name="buttonItalic"
Width="24"
Margin="0 0 2 0"
Checked="buttonItalic_Click"
Content="I"
FontStyle="Italic"
FontWeight="Bold"
Unchecked="buttonItalic_Click" />
</StackPanel>
</StackPanel>
</Grid>
<TextBox x:Name="targetText"
Height="70"
Margin="2"
AcceptsReturn="True"
Background="GhostWhite"
FontFamily="{Binding Path=SelectedItem.Content,
ElementName=comboFontFamily,
FallbackValue=Portable User Interface}"
FontSize="{Binding Path=SelectedItem.Content,
ElementName=comboFontSize,
FallbackValue=12}" />
<TextBlock Margin="0 15 0 5" Text="Drafts" />
<ListBox MinHeight="70"
DisplayMemberPath="Title"
ItemsSource="{Binding Drafts}"
SelectedItem="{Binding SelectedDraft,
Mode=TwoWay}" />
<Border Margin="-45 15 -45 0"
Background="#f0f4fa"
BorderBrush="#dde6f1"
BorderThickness="0 1 0 0">
<StackPanel Margin="0 5"
HorizontalAlignment="Right"
Orientation="Horizontal">
<telerik:RadButton Width="70"
Margin="0 0 10 0"
Command="{Binding SaveDraft}"
CommandParameter="{Binding ElementName=layout}"
Content="Save" />
<telerik:RadButton Width="70"
Margin="0 0 10 0"
Command="{Binding LoadDraft}"
CommandParameter="{Binding ElementName=layout}"
Content="Load" />
<telerik:RadButton Width="70"
Command="{Binding DeleteDraft}"
Content="Delete" />
</StackPanel>
</Border>
</StackPanel>
</Border>
</Grid>
</Window>