Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Avalonia/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<AvaloniaVersion>11.3.6</AvaloniaVersion>
<AvaloniaVersion>12.0.1</AvaloniaVersion>
</PropertyGroup>
</Project>
14 changes: 0 additions & 14 deletions src/Avalonia/HandyControlDemo_Avalonia/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public override void Initialize()
public override void OnFrameworkInitializationCompleted()
{
Properties.Langs.Lang.Culture = new CultureInfo("en");
RemoveDefaultDataValidator();

if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
Expand All @@ -27,17 +26,4 @@ public override void OnFrameworkInitializationCompleted()

base.OnFrameworkInitializationCompleted();
}

private static void RemoveDefaultDataValidator()
{
// Get an array of plugins to remove
var dataValidationPluginsToRemove =
BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();

// remove each entry found
foreach (var plugin in dataValidationPluginsToRemove)
{
BindingPlugins.DataValidators.Remove(plugin);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand All @@ -44,6 +48,12 @@
<AutoGen>True</AutoGen>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
<Compile Update="UserControl\Styles\SearchBarDemo.axaml.cs">
<DependentUpon>SearchBarDemo.axaml</DependentUpon>
</Compile>
<Compile Update="UserControl\Styles\WindowDemo.axaml.cs">
<DependentUpon>WindowDemo.axaml</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Avalonia/HandyControlDemo_Avalonia/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ public static void Main(string[] args) => BuildAvaloniaApp()
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
#if DEBUG
.WithDeveloperTools()
#endif
.LogToTrace();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:data="clr-namespace:HandyControlDemo.Data"
xmlns:vm="using:HandyControlDemo.ViewModel"
x:DataType="{x:Type vm:MainViewModel}"
Margin="16,16,0,16"
CornerRadius="10"
Effect="{StaticResource EffectShadow4}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<UserControl x:Class="HandyControlDemo.UserControl.MainContent"
xmlns="https://github.com/avaloniaui"
xmlns:vm="using:HandyControlDemo.ViewModel"
x:DataType="{x:Type vm:MainViewModel}"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Panel>
<Border Margin="16">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<UserControl xmlns="https://github.com/avaloniaui"
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:data="using:HandyControlDemo.Data"
x:DataType="{x:Type data:DemoDataModel}"
x:Class="HandyControlDemo.UserControl.AutoCompleteBoxDemo">
<ScrollViewer>
<hc:UniformSpacingPanel Spacing="32"
Expand Down Expand Up @@ -36,7 +38,7 @@
FilterMode="Contains"
Margin="0,16,0,0"
IsEnabled="False" />
<AutoCompleteBox Watermark="please enter content"
<AutoCompleteBox PlaceholderText="please enter content"
hc:TitleElement.Title="This item must be filled in"
Theme="{StaticResource AutoCompleteBoxExtend}"
ItemsSource="{Binding DataList}"
Expand All @@ -55,7 +57,7 @@
Margin="0,32,0,0" />
<AutoCompleteBox Width="380"
hc:TitleElement.TitleWidth="120"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.Title="The title is on the left"
hc:InfoElement.Necessary="True"
Expand Down Expand Up @@ -97,7 +99,7 @@
FilterMode="Contains"
Margin="0,16,0,0"
IsEnabled="False" />
<AutoCompleteBox Watermark="please enter content"
<AutoCompleteBox PlaceholderText="please enter content"
hc:TitleElement.Title="This item must be filled in"
Theme="{StaticResource AutoCompleteBoxExtend.Small}"
ItemsSource="{Binding DataList}"
Expand All @@ -116,7 +118,7 @@
Margin="0,32,0,0" />
<AutoCompleteBox Width="380"
hc:TitleElement.TitleWidth="120"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.Title="The title is on the left"
hc:InfoElement.Necessary="True"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<UserControl xmlns="https://github.com/avaloniaui"
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:vm="clr-namespace:HandyControlDemo.ViewModel"
x:Class="HandyControlDemo.UserControl.ComboBoxDemo"
DataContext="{Binding InputElementDemo, Source={x:Static vm:ViewModelLocator.Instance}}">
<ScrollViewer>
x:DataType="vm:InputElementDemoViewModel"
x:CompileBindings="False"
DataContext="{Binding InputElementDemo, Source={x:Static vm:ViewModelLocator.Instance}}"
>
<ScrollViewer >
<hc:UniformSpacingPanel Spacing="32"
Margin="32"
ChildWrapping="Wrap">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<UserControl xmlns="https://github.com/avaloniaui"
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:data="using:HandyControlDemo.Data"
x:DataType="{x:Type data:DemoDataModel}"
x:Class="HandyControlDemo.UserControl.ListBoxDemo">
<WrapPanel Margin="16">
<ListBox Margin="16"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<UserControl xmlns="https://github.com/avaloniaui"
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:data="using:HandyControlDemo.Data"
x:DataType="{x:Type data:DemoDataModel}"
x:Class="HandyControlDemo.UserControl.MenuDemo">
<hc:UniformSpacingPanel Spacing="16"
Margin="32">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<UserControl xmlns="https://github.com/avaloniaui"
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:vm="clr-namespace:HandyControlDemo.ViewModel"
x:Class="HandyControlDemo.UserControl.NumericUpDownDemo"
x:DataType="{x:Type vm:InputElementDemoViewModel}"
x:CompileBindings="False"
DataContext="{Binding InputElementDemo, Source={x:Static vm:ViewModelLocator.Instance}}">
<ScrollViewer>
<hc:UniformSpacingPanel Spacing="32"
Expand All @@ -21,7 +23,7 @@
hc:TitleElement.Title="This is the title"
Theme="{StaticResource NumericUpDownExtend}" />
<NumericUpDown Value="0"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.Title="This is the title"
hc:InfoElement.Necessary="True"
Theme="{StaticResource NumericUpDownExtend}" />
Expand All @@ -36,7 +38,7 @@
Value="10000"
Width="380"
hc:TitleElement.TitleWidth="140"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.Title="The title is on the left"
Theme="{StaticResource NumericUpDownExtend}"
Expand All @@ -59,7 +61,7 @@
hc:TitleElement.Title="This is the title"
Theme="{StaticResource NumericUpDownExtend}" />
<NumericUpDown Value="0"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.Title="This is the title"
hc:InfoElement.Necessary="True"
Theme="{StaticResource NumericUpDownExtend}" />
Expand All @@ -74,7 +76,7 @@
hc:InfoElement.ShowClearButton="True"
Width="380"
hc:TitleElement.TitleWidth="140"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.Title="The title is on the left"
Theme="{StaticResource NumericUpDownExtend}"
Expand All @@ -96,7 +98,7 @@
hc:TitleElement.Title="This is the title"
Theme="{StaticResource NumericUpDownExtend.Small}" />
<NumericUpDown Value="0"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.Title="This is the title"
hc:InfoElement.Necessary="True"
Theme="{StaticResource NumericUpDownExtend.Small}" />
Expand All @@ -111,7 +113,7 @@
Value="10000"
Width="380"
hc:TitleElement.TitleWidth="140"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.Title="The title is on the left"
Theme="{StaticResource NumericUpDownExtend.Small}"
Expand All @@ -134,7 +136,7 @@
hc:TitleElement.Title="This is the title"
Theme="{StaticResource NumericUpDownExtend.Small}" />
<NumericUpDown Value="0"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.Title="This is the title"
hc:InfoElement.Necessary="True"
Theme="{StaticResource NumericUpDownExtend.Small}" />
Expand All @@ -149,7 +151,7 @@
hc:InfoElement.ShowClearButton="True"
Width="380"
hc:TitleElement.TitleWidth="140"
Watermark="Please enter content"
PlaceholderText="Please enter content"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.Title="The title is on the left"
Theme="{StaticResource NumericUpDownExtend.Small}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<UserControl
DataContext="{Binding InputElementDemo, Source={x:Static vm:ViewModelLocator.Instance}}"
x:Class="HandyControlDemo.UserControl.SearchBarDemo"
x:CompileBindings="False"
x:DataType="{x:Type vm:InputElementDemoViewModel}"
xmlns="https://github.com/avaloniaui"
xmlns:data="using:HandyControlDemo.Data"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:vm="using:HandyControlDemo.ViewModel"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ScrollViewer>
<hc:UniformSpacingPanel
ChildWrapping="Wrap"
Margin="32"
Spacing="32">
<hc:UniformSpacingPanel Orientation="Vertical" Spacing="16">
<hc:SearchBar Command="{Binding SearchCommand}" CommandParameter="{Binding Text, RelativeSource={RelativeSource Self}}" />
<hc:SearchBar IsEnabled="False" />
<hc:SearchBar Theme="{StaticResource SearchBarExtend}" hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Theme="{StaticResource SearchBarExtend}"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Theme="{StaticResource SearchBarExtend}"
Width="380"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
<hc:SearchBar
Theme="{StaticResource SearchBarExtend}"
Width="380"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Orientation="Vertical" Spacing="16">
<hc:SearchBar Theme="{StaticResource SearchBarPlus}" hc:InfoElement.ShowClearButton="True" />
<hc:SearchBar IsEnabled="False" Theme="{StaticResource SearchBarPlus}" />

<hc:SearchBar
Theme="{StaticResource SearchBarPlus}"
hc:InfoElement.ShowClearButton="True"
hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Text="{Binding Email1, UpdateSourceTrigger=PropertyChanged}"
Theme="{StaticResource SearchBarPlus}"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterEmail"
hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Theme="{StaticResource SearchBarPlus}"
Width="380"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
<hc:SearchBar
Theme="{StaticResource SearchBarPlus}"
Width="380"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:InfoElement.ShowClearButton="True"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Orientation="Vertical" Spacing="16">
<hc:SearchBar
Command="{Binding SearchCommand}"
CommandParameter="{Binding Text, RelativeSource={RelativeSource Self}}"
Theme="{StaticResource SearchBar.Small}" />
<hc:SearchBar IsEnabled="False" Theme="{StaticResource SearchBar.Small}" />

<hc:SearchBar Theme="{StaticResource SearchBarExtend.Small}" hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Theme="{StaticResource SearchBarExtend.Small}"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Theme="{StaticResource SearchBarExtend.Small}"
Width="380"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
<hc:SearchBar
Theme="{StaticResource SearchBarExtend.Small}"
Width="380"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Orientation="Vertical" Spacing="16">
<hc:SearchBar Theme="{StaticResource SearchBarPlus.Small}" hc:InfoElement.ShowClearButton="True" />
<hc:SearchBar IsEnabled="False" Theme="{StaticResource SearchBarPlus.Small}" />

<hc:SearchBar
Theme="{StaticResource SearchBarPlus.Small}"
hc:InfoElement.ShowClearButton="True"
hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Text="{Binding Email1, UpdateSourceTrigger=PropertyChanged}"
Theme="{StaticResource SearchBarPlus.Small}"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterEmail"
hc:TitleElement.Title="TitleDemoStr1" />
<hc:SearchBar
Theme="{StaticResource SearchBarPlus.Small}"
Width="380"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
<hc:SearchBar
Theme="{StaticResource SearchBarPlus.Small}"
Width="380"
hc:InfoElement.Necessary="True"
hc:InfoElement.Placeholder="PlsEnterContent"
hc:InfoElement.ShowClearButton="True"
hc:TitleElement.Title="TitleDemoStr3"
hc:TitleElement.TitlePlacement="Left"
hc:TitleElement.TitleWidth="140" />
</hc:UniformSpacingPanel>
</hc:UniformSpacingPanel>
</ScrollViewer>
</UserControl>
Loading