|
| 1 | +<UserControl x:Class="MaterialDesignDemo.Domain.DocumentationLinks" |
| 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
| 7 | + xmlns:domain="clr-namespace:MaterialDesignColors.WpfExample.Domain" |
| 8 | + mc:Ignorable="d" |
| 9 | + d:DesignHeight="300" d:DesignWidth="300" |
| 10 | + d:DataContext="{d:DesignInstance domain:DemoItem, IsDesignTimeCreatable=True }"> |
| 11 | + <UserControl.Resources> |
| 12 | + <ResourceDictionary> |
| 13 | + <ResourceDictionary.MergedDictionaries> |
| 14 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" /> |
| 15 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" /> |
| 16 | + </ResourceDictionary.MergedDictionaries> |
| 17 | + <DataTemplate DataType="{x:Type domain:DocumentationLink}"> |
| 18 | + <Button x:Name="Root" ToolTip="Wiki Article" ToolTipService.InitialShowDelay="0" |
| 19 | + Style="{DynamicResource MaterialDesignFlatButton}" |
| 20 | + Command="{Binding Open}"> |
| 21 | + <StackPanel Orientation="Horizontal"> |
| 22 | + <materialDesign:PackIcon x:Name="PackIcon" Kind="BookOpenVariant" /> |
| 23 | + <TextBlock Margin="8 0 0 0" Style="{StaticResource MaterialDesignBody1TextBlock}" |
| 24 | + Text="{Binding Label, Mode=OneWay}" /> |
| 25 | + </StackPanel> |
| 26 | + </Button> |
| 27 | + <DataTemplate.Triggers> |
| 28 | + <DataTrigger Binding="{Binding Type}" Value="DemoPageSource"> |
| 29 | + <Setter TargetName="PackIcon" Property="Kind" Value="Xml" /> |
| 30 | + <Setter TargetName="Root" Property="ToolTip" Value="Demo Source" /> |
| 31 | + </DataTrigger> |
| 32 | + <DataTrigger Binding="{Binding Type}" Value="StyleSource"> |
| 33 | + <Setter TargetName="PackIcon" Property="Kind" Value="Brush" /> |
| 34 | + <Setter TargetName="Root" Property="ToolTip" Value="Style Source" /> |
| 35 | + </DataTrigger> |
| 36 | + <DataTrigger Binding="{Binding Type}" Value="Video"> |
| 37 | + <Setter TargetName="PackIcon" Property="Kind" Value="YoutubePlay" /> |
| 38 | + <Setter TargetName="Root" Property="ToolTip" Value="Video Help" /> |
| 39 | + </DataTrigger> |
| 40 | + <DataTrigger Binding="{Binding Type}" Value="ControlSource"> |
| 41 | + <Setter TargetName="PackIcon" Property="Kind" Value="CodeBraces" /> |
| 42 | + <Setter TargetName="Root" Property="ToolTip" Value="Object Source/API" /> |
| 43 | + </DataTrigger> |
| 44 | + </DataTemplate.Triggers> |
| 45 | + </DataTemplate> |
| 46 | + </ResourceDictionary> |
| 47 | + </UserControl.Resources> |
| 48 | + <Grid> |
| 49 | + <StackPanel Margin="16" Orientation="Horizontal"> |
| 50 | + <materialDesign:PackIcon Kind="Information" VerticalAlignment="Center" /> |
| 51 | + <TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Information Links:</TextBlock> |
| 52 | + <ItemsControl Margin="16 0 0 0" ItemsSource="{Binding Documentation}"> |
| 53 | + <ItemsControl.ItemsPanel> |
| 54 | + <ItemsPanelTemplate> |
| 55 | + <StackPanel Orientation="Horizontal" /> |
| 56 | + </ItemsPanelTemplate> |
| 57 | + </ItemsControl.ItemsPanel> |
| 58 | + <ItemsControl.ItemContainerStyle> |
| 59 | + <Style TargetType="ContentPresenter"> |
| 60 | + <Setter Property="Margin" Value="0 0 32 0"></Setter> |
| 61 | + </Style> |
| 62 | + </ItemsControl.ItemContainerStyle> |
| 63 | + </ItemsControl> |
| 64 | + </StackPanel> |
| 65 | + <Border BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1" /> |
| 66 | + </Grid> |
| 67 | +</UserControl> |
0 commit comments