diff --git a/Material.Avalonia/Material.Avalonia.csproj b/Material.Avalonia/Material.Avalonia.csproj
index f4d98214..fa2e5b5a 100644
--- a/Material.Avalonia/Material.Avalonia.csproj
+++ b/Material.Avalonia/Material.Avalonia.csproj
@@ -2,7 +2,7 @@
netstandard2.0
- 2.4.1
+ 2.5.0
Material.Avalonia
Larymar,SKProCH,Appleneko2001
This repository is a set of styles that will help you customize your application in an appropriate material design.
@@ -12,7 +12,16 @@
git
8
- - Add support for vertically scrolling textboxes
+ - Allow the alignment of the snackbar to be configured #116
+ - Prevent ArgumentNullException in StringToTransformConverter
+ - Replacing IBrush instead of Brush class in RippleEffect #114
+ - Deprecate and replace Transitions instead of Animations in TreeView #117
+ - Update DialogHost package, coerce styles, add examples #94
+ - Replace ContentControl in CustomDialog with ContentPresenter for Content #121
+ - Add recursive BundledTheme finding in resources for theming #120
+ - Fix doubling the padding of the Card
+ - Add Label style #123
+ - Fix show password button is not visible until clicked #124
diff --git a/Material.Demo/Models/Sample2Model.cs b/Material.Demo/Models/Sample2Model.cs
new file mode 100644
index 00000000..11e921b9
--- /dev/null
+++ b/Material.Demo/Models/Sample2Model.cs
@@ -0,0 +1,8 @@
+namespace Material.Demo.Models {
+ public class Sample2Model {
+ public Sample2Model(int number) {
+ Number = number;
+ }
+ public int Number { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Material.Demo/Pages/ComboBoxesDemo.axaml b/Material.Demo/Pages/ComboBoxesDemo.axaml
index ccb07caf..7149d9a6 100644
--- a/Material.Demo/Pages/ComboBoxesDemo.axaml
+++ b/Material.Demo/Pages/ComboBoxesDemo.axaml
@@ -5,6 +5,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
+ xmlns:assist="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
x:Class="Material.Demo.Pages.ComboBoxesDemo">
@@ -42,6 +43,14 @@
+
+
+
+
+
+
+
+
diff --git a/Material.Demo/Pages/DialogDemo.axaml b/Material.Demo/Pages/DialogDemo.axaml
index 71b72e47..0120cc5c 100644
--- a/Material.Demo/Pages/DialogDemo.axaml
+++ b/Material.Demo/Pages/DialogDemo.axaml
@@ -1,98 +1,131 @@
-
-
-
-
-
-
-
-
-
-
-
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
+ xmlns:viewModels="clr-namespace:Material.Demo.ViewModels"
+ xmlns:dialogHost="clr-namespace:DialogHost;assembly=DialogHost.Avalonia"
+ xmlns:models="clr-namespace:Material.Demo.Models"
+ x:Class="Material.Demo.Pages.DialogDemo"
+ x:DataType="viewModels:DialogDemoViewModel">
+
+
+
+
+
+
+
+
+
-
+ Your lucky number:
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+ Top level dialog with custom corner radius, using OpenDialog, passing content via the Parameter. You can pass a view model, provided a corresponding DataTemplate can be found in the scope of the root DialogHost.
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+ Margin="8" HorizontalAlignment="Center" />
+
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/Material.Demo/Pages/DialogDemo.axaml.cs b/Material.Demo/Pages/DialogDemo.axaml.cs
index d5c25b3b..182a9c9f 100644
--- a/Material.Demo/Pages/DialogDemo.axaml.cs
+++ b/Material.Demo/Pages/DialogDemo.axaml.cs
@@ -1,6 +1,10 @@
-using Avalonia;
+using System;
+using System.Diagnostics;
+using Avalonia;
using Avalonia.Controls;
+using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
+using Material.Demo.Models;
using Material.Demo.ViewModels;
using Material.Dialog;
@@ -21,5 +25,18 @@ private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
+
+ private void OpenDialogWithView(object? sender, RoutedEventArgs e) {
+ DialogHost.DialogHost.Show(this.Resources["Sample2View"]!, "MainDialogHost");
+ }
+
+ private void OpenDialogWithModel(object? sender, RoutedEventArgs e) {
+ // View that associated with this model defined at DialogContentTemplate in DialogDemo.axaml
+ DialogHost.DialogHost.Show(new Sample2Model(new Random().Next(0, 100)), "MainDialogHost");
+ }
+
+ private void OpenMoreDialogHostExamples(object? sender, RoutedEventArgs e) {
+ Process.Start(new ProcessStartInfo(){FileName = "https://github.com/AvaloniaUtils/DialogHost.Avalonia", UseShellExecute = true});
+ }
}
}
diff --git a/Material.Dialog/Converters/StringToTransformConverter.cs b/Material.Dialog/Converters/StringToTransformConverter.cs
index 751e5d3a..7da74b37 100644
--- a/Material.Dialog/Converters/StringToTransformConverter.cs
+++ b/Material.Dialog/Converters/StringToTransformConverter.cs
@@ -9,6 +9,8 @@ public class StringToTransformConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
+ if (value == null)
+ return TransformOperation.Identity;
var r = TransformOperations.Parse(value.ToString());
return r;
}
diff --git a/Material.Dialog/Views/CustomDialog.axaml b/Material.Dialog/Views/CustomDialog.axaml
index 1ceac36e..d4523432 100644
--- a/Material.Dialog/Views/CustomDialog.axaml
+++ b/Material.Dialog/Views/CustomDialog.axaml
@@ -61,7 +61,7 @@
-
+
, IHasNegativeResult
{
- private ContentControl PART_Content;
+ private ContentPresenter PART_Content;
public DialogResult Result { get; set; } = DialogResult.NoResult;
@@ -15,7 +15,7 @@ public CustomDialog()
{
this.InitializeComponent();
- PART_Content = this.Get(nameof(PART_Content));
+ PART_Content = this.Get(nameof(PART_Content));
}
public void ApplyViewModel(object vm) => PART_Content.DataContext = vm;
diff --git a/Material.Ripple/RippleEffect.cs b/Material.Ripple/RippleEffect.cs
index 558c2dad..fef16f4f 100644
--- a/Material.Ripple/RippleEffect.cs
+++ b/Material.Ripple/RippleEffect.cs
@@ -87,10 +87,10 @@ private Ripple CreateRipple()
#region Styled properties
- public static readonly StyledProperty RippleFillProperty =
- AvaloniaProperty.Register(nameof(RippleFill), SolidColorBrush.Parse("#FFF"));
+ public static readonly StyledProperty RippleFillProperty =
+ AvaloniaProperty.Register(nameof(RippleFill), SolidColorBrush.Parse("#FFF"));
- public Brush RippleFill {
+ public IBrush RippleFill {
get => GetValue(RippleFillProperty);
set => SetValue(RippleFillProperty, value);
}
diff --git a/Material.Styles/Assists/ComboBoxAssist.cs b/Material.Styles/Assists/ComboBoxAssist.cs
new file mode 100644
index 00000000..eaf36c34
--- /dev/null
+++ b/Material.Styles/Assists/ComboBoxAssist.cs
@@ -0,0 +1,15 @@
+using Avalonia;
+using Avalonia.Controls;
+
+namespace Material.Styles.Assists
+{
+ public class ComboBoxAssist
+ {
+ public static AvaloniaProperty LabelProperty = AvaloniaProperty.RegisterAttached(
+ "Label", typeof(ComboBox));
+
+ public static void SetLabel(AvaloniaObject element, string value) => element.SetValue(LabelProperty, value);
+
+ public static string GetLabel(AvaloniaObject element) => (string)element.GetValue(LabelProperty);
+ }
+}
\ No newline at end of file
diff --git a/Material.Styles/Card.xaml b/Material.Styles/Card.xaml
index 719dfdab..d1d028cf 100644
--- a/Material.Styles/Card.xaml
+++ b/Material.Styles/Card.xaml
@@ -10,15 +10,14 @@
-
+
+ ClipToBounds="False" >
@@ -28,7 +27,7 @@
ContentTemplate="{TemplateBinding ContentTemplate}" />
-
+
diff --git a/Material.Styles/ComboBox.xaml b/Material.Styles/ComboBox.xaml
index eb6f32cb..4b6148ba 100644
--- a/Material.Styles/ComboBox.xaml
+++ b/Material.Styles/ComboBox.xaml
@@ -1,7 +1,6 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Material.Styles/DialogHost.axaml b/Material.Styles/DialogHost.axaml
new file mode 100644
index 00000000..4e5cb72a
--- /dev/null
+++ b/Material.Styles/DialogHost.axaml
@@ -0,0 +1,17 @@
+
+
+
diff --git a/Material.Styles/DialogHost.xaml b/Material.Styles/DialogHost.xaml
deleted file mode 100644
index 91f2024d..00000000
--- a/Material.Styles/DialogHost.xaml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Material.Styles/DialogHost.xaml.cs b/Material.Styles/DialogHost.xaml.cs
deleted file mode 100644
index 6a92c495..00000000
--- a/Material.Styles/DialogHost.xaml.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Controls.Templates;
-
-namespace Material.Styles {
- [Obsolete("Do not use DialogHost since it doesnt ready for use!")]
- public class DialogHost : ContentControl {
-
- public static readonly StyledProperty InsideClippingProperty =
- AvaloniaProperty.Register(nameof(InsideClipping), true);
-
- ///
- /// Get or set the inside border clipping.
- ///
- public bool InsideClipping
- {
- get => GetValue(InsideClippingProperty);
- set => SetValue(InsideClippingProperty, value);
- }
-
-
- public static readonly StyledProperty