Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Aug 15, 2024
1 parent 35ec579 commit f055beb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Violeta/Controls/Toast/Toast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public static FrameworkElement Owner()
{
return Application.Current.Windows.OfType<Window>()
.Where(win => win.IsActive)
.FirstOrDefault();
.FirstOrDefault()!;
}
}
13 changes: 12 additions & 1 deletion src/Wpf.Ui.Violeta/Controls/Toast/ToastConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,29 @@ public sealed class ToastConfig
public int Time { get; set; } = NormalTime;

public ToastIcon ToastIcon { get; set; } = ToastIcon.None;

public ToastLocation Location { get; set; } = ToastLocation.TopCenter;

public FontStyle FontStyle { get; set; } = SystemFonts.MessageFontStyle;

public FontStretch FontStretch { get; set; } = FontStretches.Normal;

public double FontSize { get; set; } = SystemFonts.MessageFontSize;

public FontWeight FontWeight { get; set; } = SystemFonts.MenuFontWeight;

public double IconSize { get; set; } = 16d;

public CornerRadius CornerRadius { get; set; } = new CornerRadius(3d);
public Brush BorderBrush { get; set; } = (Brush)new BrushConverter().ConvertFromString("#1B1B1B");

public Brush BorderBrush { get; set; } = (Brush)new BrushConverter().ConvertFromString("#1B1B1B")!;

public Thickness BorderThickness { get; set; } = new Thickness(1d);

public HorizontalAlignment HorizontalContentAlignment { get; set; } = HorizontalAlignment.Left;

public VerticalAlignment VerticalContentAlignment { get; set; } = VerticalAlignment.Center;

public Thickness OffsetMargin { get; set; } = new Thickness(15d);

public ToastConfig()
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Violeta/Controls/Toast/ToastControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public double IconSize
set => SetValue(BorderBrushProperty, value);
}

public new static readonly DependencyProperty BorderBrushProperty = DependencyProperty.Register("BorderBrush", typeof(Brush), typeof(ToastControl), new PropertyMetadata((Brush)new BrushConverter().ConvertFromString("#E1E1E1")));
public new static readonly DependencyProperty BorderBrushProperty = DependencyProperty.Register("BorderBrush", typeof(Brush), typeof(ToastControl), new PropertyMetadata((Brush)new BrushConverter().ConvertFromString("#E1E1E1")!));

public new Thickness BorderThickness
{
Expand All @@ -241,7 +241,7 @@ public double IconSize
set => SetValue(BackgroundProperty, value);
}

public new static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(ToastControl), new PropertyMetadata((Brush)new BrushConverter().ConvertFromString("#FAFAFA")));
public new static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(ToastControl), new PropertyMetadata((Brush)new BrushConverter().ConvertFromString("#FAFAFA")!));

public new HorizontalAlignment HorizontalContentAlignment
{
Expand Down

0 comments on commit f055beb

Please sign in to comment.