|
| 1 | +<CommonControls:BaseControl x:Class="DemoApp.Controls.NarrateModelControl" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:i="http://schemas.microsoft.com/xaml/behaviors" |
| 7 | + xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" |
| 8 | + xmlns:base="clr-namespace:DemoApp" |
| 9 | + xmlns:local="clr-namespace:DemoApp.Controls" |
| 10 | + xmlns:Behaviors="clr-namespace:TensorStack.WPF.Behaviors;assembly=TensorStack.WPF" |
| 11 | + xmlns:CommonControls="clr-namespace:TensorStack.WPF.Controls;assembly=TensorStack.WPF" |
| 12 | + xmlns:CommonConverters="clr-namespace:TensorStack.WPF.Converters;assembly=TensorStack.WPF" |
| 13 | + xmlns:Controls="clr-namespace:DemoApp.Controls" |
| 14 | + xmlns:Common="clr-namespace:DemoApp.Common" |
| 15 | + xmlns:Views="clr-namespace:DemoApp.Views"> |
| 16 | + <Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:NarrateModelControl}}}"> |
| 17 | + <UniformGrid Columns="1"> |
| 18 | + |
| 19 | + <DockPanel> |
| 20 | + <TextBox DockPanel.Dock="Left" Text="Device" IsReadOnly="True" IsHitTestVisible="False" Width="60" FontStyle="Italic" FontSize="11" Opacity="0.7" Padding="4,2,0,0"/> |
| 21 | + <ComboBox DisplayMemberPath="Name" SelectedItem="{Binding SelectedDevice, Mode=TwoWay}" ItemsSource="{Binding Settings.Devices}" SelectionChanged="Device_SelectionChanged"/> |
| 22 | + </DockPanel> |
| 23 | + |
| 24 | + <DockPanel> |
| 25 | + <DockPanel DockPanel.Dock="Right" Width="80" Height="22" > |
| 26 | + <Button x:Name="UnloadButton" DockPanel.Dock="Right" Command="{Binding UnloadCommand}" Width="22"> |
| 27 | + <CommonControls:FontAwesome Icon="f00d" IconStyle="Solid" > |
| 28 | + <CommonControls:FontAwesome.Style> |
| 29 | + <Style TargetType="{x:Type CommonControls:FontAwesome}" BasedOn="{StaticResource {x:Type CommonControls:FontAwesome}}"> |
| 30 | + <Setter Property="Opacity" Value="0.5" /> |
| 31 | + <Style.Triggers> |
| 32 | + <DataTrigger Binding="{Binding IsEnabled, ElementName=UnloadButton}" Value="True"> |
| 33 | + <Setter Property="Opacity" Value="0.7" /> |
| 34 | + <Setter Property="Color" Value="{StaticResource DangerColour}" /> |
| 35 | + </DataTrigger> |
| 36 | + </Style.Triggers> |
| 37 | + </Style> |
| 38 | + </CommonControls:FontAwesome.Style> |
| 39 | + </CommonControls:FontAwesome> |
| 40 | + </Button> |
| 41 | + <Button x:Name="LoadButton" Command="{Binding LoadCommand}" > |
| 42 | + <Button.Style> |
| 43 | + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"> |
| 44 | + <Setter Property="Content" Value="Load" /> |
| 45 | + <Style.Triggers> |
| 46 | + <DataTrigger Binding="{Binding IsEnabled, ElementName=LoadButton}" Value="False"> |
| 47 | + <Setter Property="Content" Value="Ready" /> |
| 48 | + </DataTrigger> |
| 49 | + </Style.Triggers> |
| 50 | + </Style> |
| 51 | + </Button.Style> |
| 52 | + </Button> |
| 53 | + </DockPanel> |
| 54 | + |
| 55 | + <DockPanel> |
| 56 | + <TextBox DockPanel.Dock="Left" Text="Model" IsReadOnly="True" IsHitTestVisible="False" Width="60" FontStyle="Italic" FontSize="11" Opacity="0.7" Padding="4,2,0,0"/> |
| 57 | + <ComboBox SelectedItem="{Binding SelectedModel, Mode=TwoWay}" ItemsSource="{Binding ModelCollectionView}" IsSynchronizedWithCurrentItem="True" HorizontalContentAlignment="Stretch"> |
| 58 | + <ComboBox.ItemTemplate> |
| 59 | + <DataTemplate> |
| 60 | + <DockPanel> |
| 61 | + <CommonControls:FontAwesome DockPanel.Dock="Right" Icon="f111" Size="12" IconStyle="Solid" > |
| 62 | + <CommonControls:FontAwesome.Style> |
| 63 | + <Style TargetType="{x:Type CommonControls:FontAwesome}" BasedOn="{StaticResource {x:Type CommonControls:FontAwesome}}"> |
| 64 | + <Setter Property="Color" Value="#10FFFFFF"/> |
| 65 | + <Style.Triggers> |
| 66 | + <DataTrigger Binding="{Binding IsValid}" Value="True"> |
| 67 | + <Setter Property="Color" Value="{StaticResource AccentColour1}"/> |
| 68 | + </DataTrigger> |
| 69 | + </Style.Triggers> |
| 70 | + </Style> |
| 71 | + </CommonControls:FontAwesome.Style> |
| 72 | + </CommonControls:FontAwesome> |
| 73 | + <TextBlock Text="{Binding Name}" /> |
| 74 | + </DockPanel> |
| 75 | + </DataTemplate> |
| 76 | + </ComboBox.ItemTemplate> |
| 77 | + </ComboBox> |
| 78 | + </DockPanel> |
| 79 | + </DockPanel> |
| 80 | + |
| 81 | + </UniformGrid> |
| 82 | + </Grid> |
| 83 | +</CommonControls:BaseControl> |
0 commit comments