|
| 1 | +<UserControl x:Class="MaterialDesignDemo.ToolTips" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:domain="clr-namespace:MaterialDesignDemo.Shared.Domain;assembly=MaterialDesignDemo.Shared" |
| 6 | + xmlns:local="clr-namespace:MaterialDesignDemo" |
| 7 | + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML" |
| 10 | + d:DataContext="{d:DesignInstance Type=domain:ToolTipsViewModel}" |
| 11 | + d:DesignHeight="450" |
| 12 | + d:DesignWidth="800" |
| 13 | + mc:Ignorable="d"> |
| 14 | + <UserControl.Resources> |
| 15 | + <ResourceDictionary> |
| 16 | + <ResourceDictionary.MergedDictionaries> |
| 17 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" /> |
| 18 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" /> |
| 19 | + </ResourceDictionary.MergedDictionaries> |
| 20 | + <Thickness x:Key="Spacer">0,16,0,0</Thickness> |
| 21 | + </ResourceDictionary> |
| 22 | + </UserControl.Resources> |
| 23 | + <StackPanel> |
| 24 | + <TextBlock Style="{StaticResource PageTitleTextBlock}" Text="ToolTip" /> |
| 25 | + |
| 26 | + <TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Default" /> |
| 27 | + |
| 28 | + <smtx:XamlDisplay UniqueKey="toolTip_1"> |
| 29 | + <Button HorizontalAlignment="Left" |
| 30 | + Content="Example" |
| 31 | + ToolTip="This a simple tooltip" /> |
| 32 | + </smtx:XamlDisplay> |
| 33 | + |
| 34 | + <Rectangle Style="{StaticResource PageSectionSeparator}" /> |
| 35 | + |
| 36 | + <TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Rich tool tips" /> |
| 37 | + |
| 38 | + <Grid> |
| 39 | + <Grid.ColumnDefinitions> |
| 40 | + <ColumnDefinition Width="*" /> |
| 41 | + <ColumnDefinition Width="250" /> |
| 42 | + </Grid.ColumnDefinitions> |
| 43 | + |
| 44 | + <Grid Grid.Column="0"> |
| 45 | + |
| 46 | + <smtx:XamlDisplay HorizontalAlignment="Center" |
| 47 | + VerticalAlignment="Center" |
| 48 | + UniqueKey="richToolTip_1"> |
| 49 | + |
| 50 | + <materialDesign:PopupBox IsPopupOpen="{Binding IsPopupOpen}" |
| 51 | + PlacementMode="{Binding SelectedPopupBoxPlacementMode}" |
| 52 | + PopupAnimation="{Binding SelectedPopupAnimation}" |
| 53 | + PopupElevation="{Binding SelectedElevation}" |
| 54 | + PopupHorizontalOffset="{Binding PopupHorizontalOffset}" |
| 55 | + PopupMode="{Binding SelectedPopupBoxPopupMode}" |
| 56 | + PopupUniformCornerRadius="{Binding PopupUniformCornerRadius}" |
| 57 | + PopupVerticalOffset="{Binding PopupVerticalOffset}"> |
| 58 | + <materialDesign:PopupBox.ToggleContent> |
| 59 | + <materialDesign:PackIcon Width="40" |
| 60 | + Height="{Binding ActualWidth, RelativeSource={RelativeSource Mode=Self}}" |
| 61 | + Foreground="DodgerBlue" |
| 62 | + Kind="Information" /> |
| 63 | + </materialDesign:PopupBox.ToggleContent> |
| 64 | + <materialDesign:PopupBox.PopupContent> |
| 65 | + <Grid Width="312" Margin="16,12,16,8"> |
| 66 | + <Grid.RowDefinitions> |
| 67 | + <RowDefinition Height="Auto" /> |
| 68 | + <RowDefinition Height="4" /> |
| 69 | + <RowDefinition Height="*" /> |
| 70 | + <RowDefinition Height="12" /> |
| 71 | + <RowDefinition Height="Auto" /> |
| 72 | + </Grid.RowDefinitions> |
| 73 | + |
| 74 | + <TextBlock Grid.Row="0" |
| 75 | + Style="{StaticResource MaterialDesignSubtitle1TextBlock}" |
| 76 | + Text="Rich tooltip" /> |
| 77 | + <TextBlock Grid.Row="2" |
| 78 | + Text="Rich tooltips bring attention to a particular element of feature that warrants the user's focus. It supports multiple lines of informational text." |
| 79 | + TextWrapping="Wrap" /> |
| 80 | + |
| 81 | + <StackPanel Grid.Row="4" Orientation="Horizontal"> |
| 82 | + <Button Content="Action 1" Style="{StaticResource MaterialDesignFlatButton}" /> |
| 83 | + <Button Margin="4,0,0,0" |
| 84 | + Content="Action 2" |
| 85 | + Style="{StaticResource MaterialDesignFlatButton}" /> |
| 86 | + </StackPanel> |
| 87 | + </Grid> |
| 88 | + </materialDesign:PopupBox.PopupContent> |
| 89 | + </materialDesign:PopupBox> |
| 90 | + </smtx:XamlDisplay> |
| 91 | + </Grid> |
| 92 | + |
| 93 | + <StackPanel Grid.Column="1"> |
| 94 | + <GroupBox Padding="8"> |
| 95 | + <GroupBox.Header> |
| 96 | + <StackPanel Orientation="Horizontal"> |
| 97 | + <materialDesign:PackIcon Kind="Wrench" /> |
| 98 | + <TextBlock Margin="8,0,0,0" Text="Properties" /> |
| 99 | + |
| 100 | + </StackPanel> |
| 101 | + </GroupBox.Header> |
| 102 | + |
| 103 | + <StackPanel Orientation="Vertical"> |
| 104 | + <Button HorizontalAlignment="Stretch" |
| 105 | + Command="{Binding ResetToDefaultsCommand}" |
| 106 | + Content="{materialDesign:PackIcon Kind=Reload}" /> |
| 107 | + |
| 108 | + <DockPanel Margin="{StaticResource Spacer}"> |
| 109 | + <ToggleButton DockPanel.Dock="Right" |
| 110 | + IsChecked="{Binding IsPopupOpen}" |
| 111 | + Style="{StaticResource MaterialDesignSwitchToggleButton}" /> |
| 112 | + <TextBlock DockPanel.Dock="Left" Text="IsPopupOpen" /> |
| 113 | + </DockPanel> |
| 114 | + |
| 115 | + <ComboBox Margin="{StaticResource Spacer}" |
| 116 | + materialDesign:HintAssist.Hint="PopupElevation" |
| 117 | + materialDesign:TextFieldAssist.HasLeadingIcon="True" |
| 118 | + materialDesign:TextFieldAssist.LeadingIcon="Layers" |
| 119 | + ItemsSource="{Binding Elevations}" |
| 120 | + SelectedItem="{Binding SelectedElevation}" |
| 121 | + Style="{StaticResource MaterialDesignFilledComboBox}" /> |
| 122 | + |
| 123 | + <materialDesign:NumericUpDown Margin="{StaticResource Spacer}" |
| 124 | + materialDesign:HintAssist.Hint="PopupUniformCornerRadius" |
| 125 | + materialDesign:TextFieldAssist.HasLeadingIcon="True" |
| 126 | + materialDesign:TextFieldAssist.LeadingIcon="BorderRadius" |
| 127 | + Minimum="0" |
| 128 | + Style="{StaticResource MaterialDesignFilledNumericUpDown}" |
| 129 | + Value="{Binding PopupUniformCornerRadius}" /> |
| 130 | + |
| 131 | + <materialDesign:NumericUpDown Margin="{StaticResource Spacer}" |
| 132 | + materialDesign:HintAssist.Hint="PopupHorizontalOffset" |
| 133 | + materialDesign:TextFieldAssist.HasLeadingIcon="True" |
| 134 | + materialDesign:TextFieldAssist.LeadingIcon="CompareHorizontal" |
| 135 | + Style="{StaticResource MaterialDesignFilledNumericUpDown}" |
| 136 | + Value="{Binding PopupHorizontalOffset}" /> |
| 137 | + |
| 138 | + <materialDesign:NumericUpDown Margin="{StaticResource Spacer}" |
| 139 | + materialDesign:HintAssist.Hint="PopupVerticalOffset" |
| 140 | + materialDesign:TextFieldAssist.HasLeadingIcon="True" |
| 141 | + materialDesign:TextFieldAssist.LeadingIcon="CompareVertical" |
| 142 | + Style="{StaticResource MaterialDesignFilledNumericUpDown}" |
| 143 | + Value="{Binding PopupVerticalOffset}" /> |
| 144 | + |
| 145 | + <ComboBox Margin="{StaticResource Spacer}" |
| 146 | + materialDesign:HintAssist.Hint="PlacementMode" |
| 147 | + ItemsSource="{Binding PopupBoxPlacementModes}" |
| 148 | + SelectedItem="{Binding SelectedPopupBoxPlacementMode}" |
| 149 | + Style="{StaticResource MaterialDesignFilledComboBox}" /> |
| 150 | + |
| 151 | + <ComboBox Margin="{StaticResource Spacer}" |
| 152 | + materialDesign:HintAssist.Hint="PopupAnimation" |
| 153 | + ItemsSource="{Binding PopupAnimations}" |
| 154 | + SelectedItem="{Binding SelectedPopupAnimation}" |
| 155 | + Style="{StaticResource MaterialDesignFilledComboBox}" /> |
| 156 | + |
| 157 | + <ComboBox Margin="{StaticResource Spacer}" |
| 158 | + materialDesign:HintAssist.Hint="PopupBoxPopupMode" |
| 159 | + ItemsSource="{Binding PopupBoxPopupModes}" |
| 160 | + SelectedItem="{Binding SelectedPopupBoxPopupMode}" |
| 161 | + Style="{StaticResource MaterialDesignFilledComboBox}" /> |
| 162 | + </StackPanel> |
| 163 | + </GroupBox> |
| 164 | + </StackPanel> |
| 165 | + </Grid> |
| 166 | + </StackPanel> |
| 167 | +</UserControl> |
0 commit comments