终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

69 行
3.2 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.UserControls.Toast"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
  7. xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters"
  10. Width="Auto"
  11. Height="Auto"
  12. MinWidth="100"
  13. MinHeight="50"
  14. MaxWidth="1500"
  15. MaxHeight="500"
  16. d:DesignHeight="48"
  17. d:DesignWidth="200"
  18. Focusable="False"
  19. MouseLeftButtonDown="UserControl_MouseLeftButtonDown"
  20. mc:Ignorable="d">
  21. <UserControl.Resources>
  22. <con:ToastIconConverter x:Key="IconConverter"></con:ToastIconConverter>
  23. </UserControl.Resources>
  24. <Border CornerRadius="{Binding CornerRadius}"
  25. BorderThickness="{Binding BorderThickness}"
  26. Background="{Binding Background}"
  27. BorderBrush="{Binding BorderBrush}"
  28. HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="1">
  29. <Border.Effect>
  30. <DropShadowEffect Color="#D1D1D1" BlurRadius="10" ShadowDepth="0" Opacity="0.5" />
  31. </Border.Effect>
  32. <Grid x:Name="grid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition Width="Auto"/>
  35. <ColumnDefinition Width="10"/>
  36. <ColumnDefinition Width="Auto"/>
  37. </Grid.ColumnDefinitions>
  38. <iconPacks:PackIconFontAwesome x:Name="icon_toast" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10 0 0 0"
  39. Foreground="{Binding IconForeground}"
  40. Width="{Binding IconSize}"
  41. Height="{Binding IconSize}">
  42. <iconPacks:PackIconFontAwesome.Kind>
  43. <MultiBinding Converter="{StaticResource IconConverter}">
  44. <Binding Path="Icon"/>
  45. <Binding ElementName="grid"/>
  46. <Binding ElementName="txt_toast"/>
  47. </MultiBinding>
  48. </iconPacks:PackIconFontAwesome.Kind>
  49. </iconPacks:PackIconFontAwesome>
  50. <TextBlock x:Name="txt_toast" Grid.Column="2" Text="{Binding Message}"
  51. MaxWidth="{Binding TextWidth}" Height="Auto" TextWrapping="Wrap"
  52. Foreground="{Binding Foreground}"
  53. FontStyle="{Binding FontStyle}"
  54. FontStretch="{Binding FontStretch}"
  55. FontSize="{Binding FontSize}"
  56. FontFamily="{Binding FontFamily}"
  57. FontWeight="{Binding FontWeight}"
  58. VerticalAlignment="{Binding VerticalContentAlignment}"
  59. HorizontalAlignment="{Binding HorizontalContentAlignment}" Padding="0 5 10 5">
  60. </TextBlock>
  61. </Grid>
  62. </Border>
  63. </UserControl>