Stylet/StyletIntegrationTests/ShellView.xaml

60 lines
3.3 KiB
Plaintext
Raw Normal View History

2014-04-04 05:04:53 -07:00
<Window x:Class="StyletIntegrationTests.ShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="https://github.com/canton7/Stylet"
2015-09-24 05:02:54 -07:00
Title="ShellView" Height="500" Width="500" SizeToContent="Height">
2014-04-04 05:04:53 -07:00
<DockPanel LastChildFill="False">
<GroupBox DockPanel.Dock="Top" Header="ShowDialog and DialogResult" Padding="10">
<StackPanel Orientation="Horizontal">
2015-09-24 02:34:19 -07:00
<Button Command="{s:Action ShowDialogAndDialogResult}" Content="Show Dialog"/>
2014-04-04 05:04:53 -07:00
<TextBlock Margin="50,0,0,0">Result: </TextBlock>
<TextBlock Margin="10,0,0,0" Text="{Binding ShowDialogAndDialogResultDialogResult}"/>
</StackPanel>
</GroupBox>
<GroupBox DockPanel.Dock="Top" Header="Window Lifecycle" Padding="10">
<Button Command="{s:Action ShowWindowLifecycle}">Show Window</Button>
</GroupBox>
2014-05-09 07:43:55 -07:00
<GroupBox DockPanel.Dock="Top" Header="OnUnhandledException" Padding="10">
2014-05-10 12:11:02 -07:00
<DockPanel>
<TextBlock DockPanel.Dock="Top" TextWrapping="WrapWithOverflow">Verify that pressing the button below shows a dialog, containing the message 'Unhandled Exception: Hello'.</TextBlock>
<Button DockPanel.Dock="Top" Command="{s:Action ThrowException}">Throw Exception</Button>
</DockPanel>
2014-05-09 07:43:55 -07:00
</GroupBox>
2014-05-10 12:11:02 -07:00
<GroupBox DockPanel.Dock="Top" Header="Dispatcher" Padding="10">
<DockPanel>
<TextBlock DockPanel.Dock="Top" TextWrapping="WrapWithOverflow">Verify that pressing the button shows a MessageBox saying 'Success'.</TextBlock>
<Button DockPanel.Dock="Top" Command="{s:Action TestDispatcher}">Test Dispatcher</Button>
</DockPanel>
</GroupBox>
<GroupBox DockPanel.Dock="Top" Header="ActionTarget" Padding="10">
<DockPanel>
2015-09-24 02:34:19 -07:00
<TextBlock DockPanel.Dock="Top" TextWrapping="WrapWithOverflow">
Verify that pressing ctrl+s in the text box creates a dialog. Also verify that right-clicking in the text box and clicking the menu item shows a dialog.
</TextBlock>
<TextBox DockPanel.Dock="Top">
<TextBox.InputBindings>
<KeyBinding Key="S" Modifiers="Ctrl" Command="{s:Action ShowActionTargetSaved}"/>
</TextBox.InputBindings>
2015-09-24 02:34:19 -07:00
<TextBox.ContextMenu>
<ContextMenu>
2015-09-24 05:02:54 -07:00
<MenuItem Header="Click Me" Command="{s:Action ShowActionTargetSaved}"/>
2015-09-24 02:34:19 -07:00
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
<Button DockPanel.Dock="Top" s:View.ActionTarget="{Binding ChildViewModel}" Command="{s:Action Foo}">Click Me</Button>
</DockPanel>
</GroupBox>
2015-09-24 05:02:54 -07:00
<GroupBox DockPanel.Dock="Top" Header="{}{ViewModel}" Padding="10">
<DockPanel DataContext="{x:Null}">
<TextBlock DockPanel.Dock="Top">Ensure that the label below displays the text "Pass":</TextBlock>
<TextBlock DockPanel.Dock="Top" Text="{s:ViewModelBinding ViewModelTestLabel}"/>
2015-09-24 05:02:54 -07:00
</DockPanel>
</GroupBox>
2014-04-04 05:04:53 -07:00
</DockPanel>
</Window>