Update demo
This commit is contained in:
+11
-14
@@ -1,18 +1,15 @@
|
||||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
x:Class="Material.Demo.App">
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml" />
|
||||
<themes:MaterialTheme BaseTheme="Light" PrimaryColor="Purple" SecondaryColor="Lime" />
|
||||
<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml" />
|
||||
<StyleInclude Source="avares://Material.DataGrid/DataGrid.xaml" />
|
||||
<StyleInclude Source="avares://ShowMeTheXaml.Avalonia/XamlDisplay.xaml" />
|
||||
<StyleInclude Source="avares://Material.Demo/MaterialXamlDisplay.axaml" />
|
||||
|
||||
<Style Selector="showMeTheXaml|XamlDisplay">
|
||||
<Setter Property="ClipToBounds" Value="False"></Setter>
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
x:Class="Material.Demo.App" >
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml" />
|
||||
<themes:MaterialTheme BaseTheme="Light"
|
||||
PrimaryColor="Purple"
|
||||
SecondaryColor="Indigo" />
|
||||
|
||||
<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml" />
|
||||
<StyleInclude Source="avares://Material.DataGrid/DataGrid.xaml" />
|
||||
<StyleInclude Source="avares://Material.Demo/MaterialXamlDisplay.axaml" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Material.Demo.Commands
|
||||
{
|
||||
public class TextBoxCopyAllTextCommand : ICommand
|
||||
{
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return parameter is TextBox;
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
if (parameter is not TextBox textBox)
|
||||
return;
|
||||
|
||||
Application.Current?
|
||||
.Clipboard?
|
||||
.SetTextAsync(textBox.Text);
|
||||
}
|
||||
|
||||
public event EventHandler? CanExecuteChanged;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:pages="clr-namespace:Material.Demo.Pages"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
|
||||
Width="1280" Height="720" MinWidth="720"
|
||||
Title="Material.Demo">
|
||||
@@ -29,20 +30,20 @@
|
||||
</Style>
|
||||
</Window.Styles>
|
||||
|
||||
<styles:SnackbarHost HostName="Root" TemplateApplied="TemplatedControl_OnTemplateApplied">
|
||||
<styles:NavigationDrawer Name="LeftDrawer"
|
||||
<controls:SnackbarHost HostName="Root" TemplateApplied="TemplatedControl_OnTemplateApplied">
|
||||
<controls:NavigationDrawer Name="LeftDrawer" Classes="permanent"
|
||||
LeftDrawerOpened="{Binding ElementName=NavDrawerSwitch, Path=IsChecked, Mode=TwoWay}">
|
||||
<styles:NavigationDrawer.LeftDrawerContent>
|
||||
<controls:NavigationDrawer.LeftDrawerContent>
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<styles:ColorZone Mode="Accent" Height="180">
|
||||
<controls:ColorZone Mode="Accent" Height="180">
|
||||
<StackPanel>
|
||||
<Image Width="120" Height="120" HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||
Source="avares://Material.Demo/Assets/FavIcon_200x.png" Margin="0,0,0,-8" />
|
||||
<TextBlock Classes="Headline6" Text="Material Design" HorizontalAlignment="Center" />
|
||||
<TextBlock Classes="Subtitle1" Text="with AvaloniaUI" HorizontalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
<ListBox Classes="NoScroll" Name="DrawerList"
|
||||
Focusable="{Binding ElementName=LeftDrawer, Path=LeftDrawerOpened}">
|
||||
<ListBox.Styles>
|
||||
@@ -76,9 +77,9 @@
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</styles:NavigationDrawer.LeftDrawerContent>
|
||||
</controls:NavigationDrawer.LeftDrawerContent>
|
||||
<DockPanel LastChildFill="true">
|
||||
<styles:ColorZone Name="PART_AppBarContainer" VerticalAlignment="Top" HorizontalAlignment="Stretch"
|
||||
<controls:ColorZone Name="PART_AppBarContainer" VerticalAlignment="Top" HorizontalAlignment="Stretch"
|
||||
DockPanel.Dock="Top"
|
||||
Height="56" Mode="PrimaryMid" ZIndex="1">
|
||||
<Grid Margin="16">
|
||||
@@ -90,7 +91,7 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToggleButton Name="NavDrawerSwitch"
|
||||
Classes="Flat TransparentBack"
|
||||
Foreground="{DynamicResource MaterialDesignBody}"
|
||||
Width="32" Height="32" Padding="4">
|
||||
<avalonia:MaterialIcon Kind="Menu" Width="24" Height="24" />
|
||||
</ToggleButton>
|
||||
@@ -116,7 +117,7 @@
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
<ScrollViewer Name="mainScroller"
|
||||
DockPanel.Dock="Top"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
@@ -127,7 +128,7 @@
|
||||
<Carousel Name="PageCarousel"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Carousel.Styles>
|
||||
<Style Selector="Carousel#PageCarousel:not(.notransitions)">
|
||||
<Style Selector="Carousel#PageCarousel:not(.no-transitions)">
|
||||
<Setter Property="PageTransition">
|
||||
<PageSlide Duration="0.25" SlideOutEasing="CircularEaseOut"
|
||||
SlideInEasing="CircularEaseOut" />
|
||||
@@ -197,6 +198,6 @@
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</styles:NavigationDrawer>
|
||||
</styles:SnackbarHost>
|
||||
</controls:NavigationDrawer>
|
||||
</controls:SnackbarHost>
|
||||
</Window>
|
||||
@@ -7,6 +7,7 @@ using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Material.Styles;
|
||||
using Material.Styles.Controls;
|
||||
using Material.Styles.Models;
|
||||
|
||||
namespace Material.Demo {
|
||||
@@ -46,9 +47,11 @@ namespace Material.Demo {
|
||||
DrawerSelectionChanged(sender, null);
|
||||
}
|
||||
|
||||
public void DrawerSelectionChanged(object sender, RoutedEventArgs args)
|
||||
public void DrawerSelectionChanged(object sender, RoutedEventArgs? args)
|
||||
{
|
||||
var listBox = sender as ListBox;
|
||||
if (sender is not ListBox listBox)
|
||||
return;
|
||||
|
||||
if (!listBox.IsFocused && !listBox.IsKeyboardFocusWithin)
|
||||
return;
|
||||
try
|
||||
@@ -57,11 +60,12 @@ namespace Material.Demo {
|
||||
mainScroller.Offset = Vector.Zero;
|
||||
mainScroller.VerticalScrollBarVisibility =
|
||||
listBox.SelectedIndex == 5 ? ScrollBarVisibility.Disabled : ScrollBarVisibility.Auto;
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
NavDrawerSwitch.IsChecked = false;
|
||||
}
|
||||
|
||||
@@ -70,7 +74,7 @@ namespace Material.Demo {
|
||||
SnackbarHost.Post("Welcome to demo of Material.Avalonia!");
|
||||
}
|
||||
|
||||
private List<SnackbarModel> helloSnackBars = new List<SnackbarModel>();
|
||||
private readonly List<SnackbarModel> helloSnackBars = new();
|
||||
|
||||
private void HelloButtonMenuItem_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="0.10.11" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.11" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
|
||||
<PackageReference Include="Avalonia" Version="0.10.14" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.14" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.10.14" />
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.14" />
|
||||
<PackageReference Include="Material.Icons.Avalonia" Version="1.0.2" />
|
||||
<PackageReference Include="ShowMeTheXaml.Avalonia.Generator" Version="0.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,46 +1,78 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles">
|
||||
<Style Selector="showMeTheXaml|XamlDisplay">
|
||||
<Setter Property="Template">
|
||||
xmlns:assists="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
||||
xmlns:commands="clr-namespace:Material.Demo.Commands" >
|
||||
<Styles.Resources>
|
||||
<commands:TextBoxCopyAllTextCommand x:Key="TextBoxCopyAllTextCommand"/>
|
||||
</Styles.Resources>
|
||||
|
||||
<Style Selector="showMeTheXaml|XamlDisplay" >
|
||||
<Setter Property="ClipToBounds" Value="False" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Template" >
|
||||
<ControlTemplate>
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Grid.Resources>
|
||||
<DockPanel>
|
||||
<DockPanel.Resources>
|
||||
<showMeTheXaml:AlignmentYConverter x:Key="AlignmentYConverter" />
|
||||
</Grid.Resources>
|
||||
<Border Grid.Column="0"
|
||||
BorderThickness="4"
|
||||
BorderBrush="{TemplateBinding Foreground}"
|
||||
Opacity="0.5"
|
||||
IsVisible="{Binding #XamlPopup.IsOpen}" />
|
||||
<ContentPresenter Grid.Column="0" Margin="4"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
Padding="{TemplateBinding Padding}" />
|
||||
<Viewbox Name="SourceXamlButton" Grid.Column="1"
|
||||
</DockPanel.Resources>
|
||||
|
||||
<Viewbox Name="SourceXamlButton"
|
||||
Height="16" Width="16"
|
||||
VerticalAlignment="{TemplateBinding XamlButtonAlignment, Converter={x:Static showMeTheXaml:AlignmentYConverter.Instance}}">
|
||||
<Grid Background="Transparent">
|
||||
DockPanel.Dock="Right"
|
||||
VerticalAlignment="{TemplateBinding XamlButtonAlignment,
|
||||
Converter={x:Static showMeTheXaml:AlignmentYConverter.Instance}}" >
|
||||
<Panel Background="Transparent" >
|
||||
<Path Fill="{TemplateBinding Foreground}"
|
||||
Data="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z" />
|
||||
</Grid>
|
||||
</Panel>
|
||||
</Viewbox>
|
||||
<Popup Name="XamlPopup" Grid.Column="1" IsLightDismissEnabled="True">
|
||||
<styles:Card>
|
||||
<ScrollViewer MaxWidth="400" MaxHeight="400"
|
||||
VerticalAlignment="Top"
|
||||
Background="{TemplateBinding Background}"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<TextBox ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
IsReadOnly="True" TextWrapping="Wrap"
|
||||
|
||||
<Popup Name="XamlPopup"
|
||||
IsLightDismissEnabled="True" >
|
||||
<Border CornerRadius="4"
|
||||
Background="{DynamicResource MaterialDesignCardBackground}"
|
||||
BorderBrush="{DynamicResource MaterialDesignBody}"
|
||||
BorderThickness="2"
|
||||
MaxWidth="800"
|
||||
MinHeight="100"
|
||||
MaxHeight="400"
|
||||
Padding="8" >
|
||||
<Grid RowDefinitions="*, 8, Auto" >
|
||||
<TextBox Grid.Row="0"
|
||||
Name="PART_TextBox"
|
||||
IsReadOnly="True"
|
||||
TextWrapping="Wrap"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
assists:TextFieldAssist.Hints="xaml code for this control"
|
||||
Text="{TemplateBinding XamlText}" />
|
||||
</ScrollViewer>
|
||||
</styles:Card>
|
||||
|
||||
<Button Grid.Row="2"
|
||||
Classes="flat"
|
||||
Content="COPY XAML"
|
||||
Command="{StaticResource TextBoxCopyAllTextCommand}"
|
||||
CommandParameter="{Binding ElementName=PART_TextBox}"
|
||||
HorizontalAlignment="Right" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
|
||||
<Panel DockPanel.Dock="Left" >
|
||||
<Border BorderThickness="4"
|
||||
BorderBrush="{TemplateBinding Foreground}"
|
||||
Opacity="0.5"
|
||||
IsVisible="{Binding #XamlPopup.IsOpen}"
|
||||
CornerRadius="2" />
|
||||
<ContentPresenter Margin="4"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
Padding="{TemplateBinding Padding}" />
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
@@ -7,9 +7,26 @@
|
||||
xmlns:assist="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.ButtonsDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="showMeTheXaml|XamlDisplay Button">
|
||||
<Setter Property="IsEnabled"
|
||||
Value="{Binding ElementName=IsEnabledCheckBox, Path=IsChecked}"/>
|
||||
</Style>
|
||||
|
||||
<Style Selector="showMeTheXaml|XamlDisplay controls|FloatingButton">
|
||||
<Setter Property="IsEnabled"
|
||||
Value="{Binding ElementName=IsEnabledCheckBox, Path=IsChecked}"/>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Buttons" />
|
||||
<CheckBox Name="IsEnabledCheckBox"
|
||||
Content="Buttons is enabled"
|
||||
IsChecked="True"/>
|
||||
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Regular buttons" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="Buttons1">
|
||||
@@ -62,7 +79,7 @@
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Floating buttons with icon" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="styles|FloatingButton">
|
||||
<Style Selector="controls|FloatingButton">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
@@ -80,28 +97,28 @@
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons0">
|
||||
<styles:FloatingButton Classes="Light Mini" />
|
||||
<controls:FloatingButton Classes="Light Mini" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons1">
|
||||
<styles:FloatingButton Classes="Mini" />
|
||||
<controls:FloatingButton Classes="Mini" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons2">
|
||||
<styles:FloatingButton Classes="Dark Mini" />
|
||||
<controls:FloatingButton Classes="Dark Mini" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons3">
|
||||
<styles:FloatingButton Classes="Accent Mini" />
|
||||
<controls:FloatingButton Classes="Accent Mini" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons4">
|
||||
<styles:FloatingButton Classes="Light" />
|
||||
<controls:FloatingButton Classes="Light" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons5">
|
||||
<styles:FloatingButton />
|
||||
<controls:FloatingButton />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons6">
|
||||
<styles:FloatingButton Classes="Dark" />
|
||||
<controls:FloatingButton Classes="Dark" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons7">
|
||||
<styles:FloatingButton Classes="Accent" />
|
||||
<controls:FloatingButton Classes="Accent" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
@@ -111,7 +128,7 @@
|
||||
<Style Selector="showMeTheXaml|XamlDisplay">
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
<Style Selector="styles|FloatingButton[IsExtended=false]">
|
||||
<Style Selector="controls|FloatingButton[IsExtended=false]">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
@@ -124,7 +141,7 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="styles|FloatingButton[IsExtended=true]">
|
||||
<Style Selector="controls|FloatingButton[IsExtended=true]">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
@@ -143,16 +160,16 @@
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton0">
|
||||
<styles:FloatingButton Classes="Light" IsExtended="True" />
|
||||
<controls:FloatingButton Classes="Light" IsExtended="True" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton1">
|
||||
<styles:FloatingButton IsExtended="True" />
|
||||
<controls:FloatingButton IsExtended="True" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton2">
|
||||
<styles:FloatingButton Classes="Dark" IsExtended="True" />
|
||||
<controls:FloatingButton Classes="Dark" IsExtended="True" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton3">
|
||||
<styles:FloatingButton Classes="Accent" IsExtended="{Binding ElementName=CheckBox1, Path=IsChecked}" />
|
||||
<controls:FloatingButton Classes="Accent" IsExtended="{Binding ElementName=CheckBox1, Path=IsChecked}" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<CheckBox Name="CheckBox1" Content="IsExtended" Margin="16,8" />
|
||||
</StackPanel>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.CardsDemo">
|
||||
<UserControl.Resources>
|
||||
<system:String x:Key="DemoText">
|
||||
@@ -21,25 +22,25 @@
|
||||
|
||||
<WrapPanel HorizontalAlignment="Stretch">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="Cards0">
|
||||
<styles:Card MinWidth="240" VerticalAlignment="Top">
|
||||
<controls:Card MinWidth="240" VerticalAlignment="Top">
|
||||
<StackPanel Margin="0,4">
|
||||
<TextBlock Classes="Headline6" Text="Card title" />
|
||||
<TextBlock Classes="Body2" Text="Secondary text" />
|
||||
</StackPanel>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="Cards1">
|
||||
<styles:Card Width="240" VerticalAlignment="Top">
|
||||
<controls:Card Width="240" VerticalAlignment="Top">
|
||||
<StackPanel Margin="0,4">
|
||||
<TextBlock Classes="Headline6" Text="Card title" />
|
||||
<TextBlock Classes="Body2" Text="Secondary text" />
|
||||
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap"
|
||||
Text="{StaticResource DemoText}"/>
|
||||
</StackPanel>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="Cards2">
|
||||
<styles:Card Width="240" Padding="4" VerticalAlignment="Top">
|
||||
<controls:Card Width="240" Padding="4" VerticalAlignment="Top">
|
||||
<StackPanel>
|
||||
<StackPanel Margin="8">
|
||||
<TextBlock Classes="Headline6" Text="Card title" />
|
||||
@@ -53,10 +54,10 @@
|
||||
<Button Classes="Flat" Content="BUTTON 2" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="Cards3">
|
||||
<styles:Card Width="240" Padding="0" VerticalAlignment="Top">
|
||||
<controls:Card Width="240" Padding="0" VerticalAlignment="Top">
|
||||
<StackPanel>
|
||||
<Image Source="avares://Material.Demo/Assets/johannes-plenio-RwHv7LgeC7s-unsplash.jpg" />
|
||||
<StackPanel Margin="16">
|
||||
@@ -65,8 +66,17 @@
|
||||
Text="{StaticResource DemoText2}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
|
||||
<controls:Card>
|
||||
<controls:CircleClockPicker Height="240" Maximum="11" Minimum="0" StepFrequency="3" Value="0"
|
||||
FirstLabelOverride="12"/>
|
||||
</controls:Card>
|
||||
|
||||
<controls:Card>
|
||||
<controls:CircleClockPicker Height="240" Maximum="59" Minimum="0" StepFrequency="5" Value="30"/>
|
||||
</controls:Card>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:icons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.ColorZonesDemo">
|
||||
<StackPanel Margin="16, 0,16,32">
|
||||
<StackPanel.Styles>
|
||||
@@ -19,96 +20,96 @@
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Standard mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo1">
|
||||
<styles:ColorZone Height="56" Padding="12">
|
||||
<controls:ColorZone Height="56" Padding="12">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Invent mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo2">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="Inverted">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="Inverted">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Dark mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo3">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="Dark">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="Dark">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Light mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo4">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="Light">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="Light">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Primary light color mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo5">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="PrimaryLight">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="PrimaryLight">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Primary medium color mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo6">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="PrimaryMid">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="PrimaryMid">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Primary dark color mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo7">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="PrimaryDark">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="PrimaryDark">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Accent mode" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo8">
|
||||
<styles:ColorZone Height="56" Padding="12" Mode="Accent">
|
||||
<controls:ColorZone Height="56" Padding="12" Mode="Accent">
|
||||
<Grid ColumnDefinitions="Auto,24,*">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
@@ -116,7 +117,7 @@
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="With menus" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneAdvDemo1">
|
||||
<styles:ColorZone Height="56" Padding="12">
|
||||
<controls:ColorZone Height="56" Padding="12">
|
||||
<Grid ColumnDefinitions="Auto,24,*,24,Auto">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
@@ -125,20 +126,20 @@
|
||||
<Button Classes="Flat" Padding="4" Content="{icons:MaterialIconExt DotsVertical}"/>
|
||||
</ReversibleStackPanel>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="With search bar" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneAdvDemo2">
|
||||
<styles:ColorZone Height="56" Padding="12">
|
||||
<controls:ColorZone Height="56" Padding="12">
|
||||
<Grid ColumnDefinitions="Auto,24,*,*,24,Auto">
|
||||
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
|
||||
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
|
||||
|
||||
<Panel Grid.Column="3" VerticalAlignment="Center">
|
||||
<styles:Card VerticalAlignment="Center" Padding="0">
|
||||
<controls:Card VerticalAlignment="Center" Padding="0">
|
||||
<TextBox Margin="0" Classes="Solo" Watermark="Search bar">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Solo /template/ Grid#PART_InnerRoot">
|
||||
@@ -149,14 +150,14 @@
|
||||
<Button Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Search, Size=24}" />
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</Panel>
|
||||
|
||||
<ReversibleStackPanel Grid.Column="5" Margin="0" Orientation="Horizontal">
|
||||
<Button Classes="Flat" Padding="4" Content="{icons:MaterialIconExt DotsVertical}"/>
|
||||
</ReversibleStackPanel>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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"
|
||||
@@ -16,7 +14,7 @@
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</UserControl.Resources>
|
||||
<dialogHost:DialogHost Identifier="MainDialogHost">
|
||||
<!--dialogHost:DialogHost Identifier="MainDialogHost">
|
||||
<dialogHost:DialogHost.DialogContentTemplate>
|
||||
<DataTemplate DataType="models:Sample2Model">
|
||||
<StackPanel>
|
||||
@@ -36,34 +34,31 @@
|
||||
|
||||
<WrapPanel>
|
||||
<WrapPanel.Styles>
|
||||
<Style Selector="WrapPanel > StackPanel,
|
||||
WrapPanel > Grid">
|
||||
<Style Selector="WrapPanel > StackPanel">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="MinHeight" Value="300" />
|
||||
</Style>
|
||||
<Style Selector="WrapPanel > StackPanel > StackPanel,
|
||||
WrapPanel > Grid > StackPanel">
|
||||
<Style Selector="WrapPanel > StackPanel > StackPanel">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
<Style
|
||||
Selector="WrapPanel > Grid > StackPanel > StackPanel,
|
||||
WrapPanel > StackPanel > StackPanel > StackPanel">
|
||||
<Style Selector="WrapPanel > StackPanel > StackPanel > StackPanel">
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
</WrapPanel.Styles>
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="From DialogHost" />
|
||||
<StackPanel>
|
||||
<TextBlock TextWrapping="Wrap">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.</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Text="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."/>
|
||||
<StackPanel Margin="8 8 8 0">
|
||||
<Button Margin="8" Click="OpenDialogWithView">PASS VIEW</Button>
|
||||
<Button Margin="8" Click="OpenDialogWithModel">PASS MODEL</Button>
|
||||
<Button Margin="8" Click="OpenMoreDialogHostExamples">MORE EXAMPLES</Button>
|
||||
<Button Click="OpenDialogWithView">PASS VIEW</Button>
|
||||
<Button Click="OpenDialogWithModel">PASS MODEL</Button>
|
||||
<Button Click="OpenMoreDialogHostExamples">MORE EXAMPLES</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Standalone dialog" />
|
||||
|
||||
@@ -91,5 +86,34 @@
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</dialogHost:DialogHost>
|
||||
</dialogHost:DialogHost -->
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Standalone dialog" />
|
||||
|
||||
<ItemsControl Items="{CompiledBinding StandaloneDialogItems}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="viewModels:DialogDemoItemViewModel">
|
||||
<DockPanel Margin="8">
|
||||
<Button DockPanel.Dock="Top"
|
||||
Classes="flat"
|
||||
Content="{CompiledBinding Header}"
|
||||
Command="{CompiledBinding Command}" />
|
||||
<TextBlock Margin="8"
|
||||
HorizontalAlignment="Center"
|
||||
TextWrapping="Wrap"
|
||||
|
||||
DockPanel.Dock="Bottom"
|
||||
|
||||
Text="{CompiledBinding Result}"
|
||||
IsVisible="{CompiledBinding Result,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty},
|
||||
FallbackValue=False}" />
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -3,11 +3,12 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="2300"
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:wpf="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.FieldsDemo">
|
||||
<UserControl.Resources>
|
||||
<system:String x:Key="TextFieldTip1">Only numerics in this field</system:String>
|
||||
@@ -29,9 +30,12 @@
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields" />
|
||||
<TextBlock Classes="Headline6 Subheadline2"
|
||||
Text="Single-Line fields" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineTextBoxes0">
|
||||
<TextBox UseFloatingWatermark="True" wpf:TextFieldAssist.Label="Classic TextBox" />
|
||||
<TextBox UseFloatingWatermark="True"
|
||||
Watermark="Type something..."
|
||||
wpf:TextFieldAssist.Label="Classic TextBox" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineTextBoxes1">
|
||||
<TextBox UseFloatingWatermark="False" Watermark="No floating label" />
|
||||
@@ -91,29 +95,29 @@
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields0">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled"
|
||||
wpf:TextFieldAssist.Label="Filled TextBox" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields1">
|
||||
<TextBox UseFloatingWatermark="False" Classes="Filled" Watermark="No floating label" />
|
||||
<TextBox UseFloatingWatermark="False" Classes="filled" Watermark="No floating label" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields2">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled revealPasswordButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled revealPasswordButton"
|
||||
wpf:TextFieldAssist.Label="Password"
|
||||
PasswordChar="*" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields3">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled clearButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled clearButton"
|
||||
wpf:TextFieldAssist.Label="Text field" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields4">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled"
|
||||
wpf:TextFieldAssist.Label="Text field with validation"
|
||||
wpf:TextFieldAssist.Hints="{StaticResource TextFieldTip1}"
|
||||
Text="{Binding Numerics}" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields5">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled" IsEnabled="False"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled" IsEnabled="False"
|
||||
wpf:TextFieldAssist.Label="Disabled Field"
|
||||
Text="Hello World!" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
@@ -121,25 +125,25 @@
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields (dense)" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields0">
|
||||
<TextBox Classes="Filled Dense" UseFloatingWatermark="False" Watermark="No floating label" />
|
||||
<TextBox Classes="filled dense" UseFloatingWatermark="False" Watermark="No floating label" />
|
||||
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields1">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled Dense"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled dense"
|
||||
wpf:TextFieldAssist.Label="Filled dense TextBox" />
|
||||
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields2">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled Dense clearButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled dense clearButton"
|
||||
wpf:TextFieldAssist.Label="Dense field with clear button" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields3">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled Dense revealPasswordButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled dense revealPasswordButton"
|
||||
wpf:TextFieldAssist.Label="Password"
|
||||
PasswordChar="*" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields4">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Filled Dense" IsEnabled="False"
|
||||
<TextBox UseFloatingWatermark="True" Classes="filled dense" IsEnabled="False"
|
||||
wpf:TextFieldAssist.Label="Disabled Field"
|
||||
Text="Hello World!" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
@@ -156,7 +160,7 @@
|
||||
<showMeTheXaml:XamlDisplay UniqueId="MultilineFields1">
|
||||
<TextBox UseFloatingWatermark="True"
|
||||
wpf:TextFieldAssist.Label="Multiline textfield"
|
||||
Classes="Filled"
|
||||
Classes="filled"
|
||||
AcceptsReturn="True"
|
||||
TextWrapping="Wrap"
|
||||
MaxHeight="100"
|
||||
@@ -184,50 +188,50 @@
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields0">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline"
|
||||
wpf:TextFieldAssist.Label="Outline TextBox" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields1">
|
||||
<TextBox UseFloatingWatermark="False" Classes="Outline" Watermark="No floating label" />
|
||||
<TextBox UseFloatingWatermark="False" Classes="outline" Watermark="No floating label" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields2">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline revealPasswordButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline revealPasswordButton"
|
||||
wpf:TextFieldAssist.Label="Password" PasswordChar="*" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields3">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline clearButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline clearButton"
|
||||
wpf:TextFieldAssist.Label="Text field" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields4">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline"
|
||||
wpf:TextFieldAssist.Label="Text field with validation"
|
||||
wpf:TextFieldAssist.Hints="{StaticResource TextFieldTip1}"
|
||||
Text="{Binding Numerics}"/>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields5">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline" IsEnabled="False"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline" IsEnabled="False"
|
||||
wpf:TextFieldAssist.Label="Disabled Field" Text="Hello World!" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields (dense)" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields0">
|
||||
<TextBox UseFloatingWatermark="False" Classes="Outline Dense" Watermark="No floating label" />
|
||||
<TextBox UseFloatingWatermark="False" Classes="outline dense" Watermark="No floating label" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields1">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline Dense"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline dense"
|
||||
wpf:TextFieldAssist.Label="Outline dense TextBox" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields2">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline Dense clearButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline dense clearButton"
|
||||
wpf:TextFieldAssist.Label="Dense field with clear button" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields3">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline Dense revealPasswordButton"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline dense revealPasswordButton"
|
||||
wpf:TextFieldAssist.Label="Password" PasswordChar="*" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields4">
|
||||
<TextBox UseFloatingWatermark="True" Classes="Outline Dense" IsEnabled="False"
|
||||
<TextBox UseFloatingWatermark="True" Classes="outline dense" IsEnabled="False"
|
||||
wpf:TextFieldAssist.Label="Disabled Field" Text="Hello World!" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
@@ -244,7 +248,7 @@
|
||||
<showMeTheXaml:XamlDisplay UniqueId="OutlineMultilineFields0">
|
||||
<TextBox UseFloatingWatermark="True"
|
||||
wpf:TextFieldAssist.Label="Multiline textfield"
|
||||
Classes="Outline"
|
||||
Classes="outline"
|
||||
MaxHeight="100"
|
||||
AcceptsReturn="True"
|
||||
TextWrapping="Wrap"
|
||||
@@ -271,28 +275,28 @@
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Solo fields" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SoloFields0">
|
||||
<styles:Card Padding="0" Margin="8">
|
||||
<TextBox Classes="Solo" Watermark="Solo field with Card">
|
||||
<controls:Card Padding="0" Margin="8">
|
||||
<TextBox Classes="solo" Watermark="Solo field with Card">
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}"
|
||||
Content="{avalonia:MaterialIconExt Search, Size=24}" />
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SoloFields1">
|
||||
<styles:ColorZone Padding="0" Margin="8">
|
||||
<TextBox Classes="Solo" Watermark="or with ColorZone">
|
||||
<controls:ColorZone Padding="0" Margin="8">
|
||||
<TextBox Classes="solo" Watermark="or with ColorZone">
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}"
|
||||
Content="{avalonia:MaterialIconExt Search, Size=24}" />
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SoloFields2">
|
||||
<styles:ColorZone Padding="0" Margin="8">
|
||||
<TextBox Watermark="Search field" Classes="Solo" Margin="0">
|
||||
<controls:ColorZone Padding="0" Margin="8">
|
||||
<TextBox Watermark="Search field" Classes="solo" Margin="0">
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Width="{Binding $self.Bounds.Height}" Classes="Flat"
|
||||
Foreground="{DynamicResource MaterialDesignCardBackground}">
|
||||
@@ -300,12 +304,12 @@
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SoloFields3">
|
||||
<TextBox BorderBrush="{Binding $self.Foreground}" BorderThickness="1" Classes="Solo"
|
||||
<TextBox BorderBrush="{Binding $self.Foreground}" BorderThickness="1" Classes="solo"
|
||||
Watermark="Search field"
|
||||
wpf:TextFieldAssist.CornerRadius="32" Margin="8">
|
||||
CornerRadius="32" Margin="8">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Border Height="{Binding $parent[TextBox].Height}" Width="{Binding $self.Bounds.Height}">
|
||||
<avalonia:MaterialIcon HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
@@ -315,7 +319,7 @@
|
||||
</TextBox>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="SoloFields4">
|
||||
<TextBox BorderBrush="Black" Margin="8" BorderThickness="1" Classes="Solo"
|
||||
<TextBox BorderBrush="Black" Margin="8" BorderThickness="1" Classes="solo"
|
||||
Watermark="No container but use border instead" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
@@ -341,5 +345,7 @@
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
|
||||
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,84 +1,82 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
xmlns:demo="clr-namespace:Material.Demo;assembly=Material.Demo"
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:models="clr-namespace:Material.Demo.Models"
|
||||
xmlns:conv="clr-namespace:Material.Demo.Converters"
|
||||
x:Class="Material.Demo.Pages.Home" >
|
||||
<UserControl.Resources>
|
||||
<conv:EnumDescriptionConverter x:Key="GetDescription"/>
|
||||
</UserControl.Resources>
|
||||
x:Class="Material.Demo.Pages.Home">
|
||||
<!--UserControl.Resources>
|
||||
<conv:EnumDescriptionConverter x:Key="GetDescription"/>
|
||||
</UserControl.Resources-->
|
||||
<StackPanel Margin="16, 0" MaxWidth="600">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="TextBlock.Content, TextBlock.Subheadline">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Image Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||
Source="avares://Material.Demo/Assets/FavIcon_200x.png" Margin="0,0,0,-8"/>
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="👋 Welcome to Material.Avalonia Demo!"/>
|
||||
<TextBlock Classes="Content" Text="Material.Avalonia is a library that could beauty and turning your Avalonia Application from regular design to Material Design like Material Design in XAML! It easy for use to your project! Just install NuGet package, slightly change your App.xaml / App.axaml and your application are ready to go with Material Design!"/>
|
||||
<TextBlock Classes="Content" Text="This project is still in development. Not all controls are ready for use, and could be buggy. Don't worry! some basic controls (Buttons, Switch, TextBox and etc.) are ready for use for now! and other controls will be ready later!"/>
|
||||
<TextBlock Classes="Content" Text="Press drawer button to start widgets tours!"/>
|
||||
<TextBlock Classes="Content" Text="For attaching AvaloniaUI DevTools - Press Shift + F12."/>
|
||||
|
||||
<StackPanel Margin="16">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Margin" Value="4"/>
|
||||
</Style>
|
||||
<Style Selector="TextBlock.Content, TextBlock.Subheadline">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<WrapPanel HorizontalAlignment="Center" MaxWidth="600" >
|
||||
<Button Classes="Flat" Content="PROJECT LINK" Command="{Binding Path=OpenProjectRepoLink}"/>
|
||||
<Button Classes="Flat" Content="USE DARK THEME" Command="{Binding Path=UseMaterialUIDarkTheme}"/>
|
||||
<Button Classes="Flat" Content="USE LIGHT THEME" Command="{Binding Path=UseMaterialUILightTheme}"/>
|
||||
</WrapPanel>
|
||||
<WrapPanel HorizontalAlignment="Center" MaxWidth="600" >
|
||||
<Button Classes="Flat" Content="SWITCH TRANSITIONS" Command="{Binding Path=SwitchTransition}"/>
|
||||
<Button Classes="Flat" Content="ABOUT AVALONIAUI" Command="{Binding Path=ShowAboutAvaloniaUI}"/>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,24">
|
||||
<DataGrid Height="620"
|
||||
IsReadOnly="True"
|
||||
Items="{Binding Path=DataContext.Features}"
|
||||
VerticalAlignment="Stretch"
|
||||
VerticalScrollBarVisibility="Disabled">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Features"
|
||||
Binding="{Binding FeatureName}"
|
||||
Width="20*" />
|
||||
<DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock TextAlignment="Right"
|
||||
Text="Is Ready"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsReady}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock TextAlignment="Right"
|
||||
Text="Is Animated"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsAnimated}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
<Image Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||
Source="avares://Material.Demo/Assets/FavIcon_200x.png" Margin="0,0,0,-8" />
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="👋 Welcome to Material.Avalonia Demo!" />
|
||||
<TextBlock Classes="Content"
|
||||
Text="Material.Avalonia is a library that could beauty and turning your Avalonia Application from regular design to Material Design like Material Design in XAML! It easy for use to your project! Just install NuGet package, slightly change your App.xaml / App.axaml and your application are ready to go with Material Design!" />
|
||||
<TextBlock Classes="Content"
|
||||
Text="This project is still in development. Not all controls are ready for use, and could be buggy. Don't worry! some basic controls (Buttons, Switch, TextBox and etc.) are ready for use for now! and other controls will be ready later!" />
|
||||
<TextBlock Classes="Content" Text="Press drawer button to start widgets tours!" />
|
||||
<TextBlock Classes="Content" Text="For attaching AvaloniaUI DevTools - Press Shift + F12." />
|
||||
|
||||
<StackPanel Margin="16">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<WrapPanel HorizontalAlignment="Center" MaxWidth="600">
|
||||
<Button Classes="Flat" Content="PROJECT LINK" Command="{Binding Path=OpenProjectRepoLink}" />
|
||||
<Button Classes="Flat" Content="USE DARK THEME" Command="{Binding Path=UseMaterialUIDarkTheme}" />
|
||||
<Button Classes="Flat" Content="USE LIGHT THEME" Command="{Binding Path=UseMaterialUILightTheme}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel HorizontalAlignment="Center" MaxWidth="600">
|
||||
<Button Classes="Flat" Content="SWITCH TRANSITIONS" Command="{Binding Path=SwitchTransition}" />
|
||||
<Button Classes="Flat" Content="ABOUT AVALONIAUI" Command="{Binding Path=ShowAboutAvaloniaUI}" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
<!-- Features listing is disabled. -->
|
||||
<!--
|
||||
<StackPanel Margin="0,24">
|
||||
<DataGrid Height="620"
|
||||
IsReadOnly="True"
|
||||
Items="{Binding Path=DataContext.Features}"
|
||||
VerticalAlignment="Stretch"
|
||||
VerticalScrollBarVisibility="Disabled">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Features"
|
||||
Binding="{Binding FeatureName}"
|
||||
Width="20*" />
|
||||
<DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock TextAlignment="Right"
|
||||
Text="Is Ready"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsReady}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock TextAlignment="Right"
|
||||
Text="Is Animated"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsAnimated}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
-->
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -13,6 +13,10 @@ namespace Material.Demo.Pages
|
||||
{
|
||||
public Home()
|
||||
{
|
||||
// Sadly I don't have much time to update this listing
|
||||
// and doesn't get updated after any changes
|
||||
// I'm gonna disable this listing
|
||||
/*
|
||||
Features = new ObservableCollection<FeatureStatusModels> {
|
||||
new FeatureStatusModels{ FeatureName = "Button (Standard)", IsReady = Yes, IsAnimated = Yes},
|
||||
new FeatureStatusModels{ FeatureName = "Button (Floating)", IsReady = Yes, IsAnimated = NotFully},
|
||||
@@ -44,13 +48,13 @@ namespace Material.Demo.Pages
|
||||
new FeatureStatusModels{ FeatureName = "Icons (Excluded, via Material.Icons.Avalonia)", IsReady = Yes, IsAnimated = NA},
|
||||
new FeatureStatusModels{ FeatureName = "Appbar (Top)", IsReady = No, IsAnimated = NA},
|
||||
new FeatureStatusModels{ FeatureName = "Appbar (Bottom)", IsReady = No, IsAnimated = NA},
|
||||
};
|
||||
};*/
|
||||
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
public ObservableCollection<FeatureStatusModels> Features { get; private set; }
|
||||
//public ObservableCollection<FeatureStatusModels> Features { get; private set; }
|
||||
|
||||
public void UseMaterialUIDarkTheme() => GlobalCommand.UseMaterialUIDarkTheme();
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime.Extensions"
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:assists="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Material.Demo.Pages.IconsDemo">
|
||||
<UserControl.Resources>
|
||||
@@ -75,16 +76,16 @@
|
||||
</ScrollViewer>
|
||||
</Panel>
|
||||
|
||||
<styles:ColorZone Mode="Standard" Padding="8" assists:ShadowAssist.ShadowDepth="Depth2">
|
||||
<controls:ColorZone Mode="Standard" Padding="8" assists:ShadowAssist.ShadowDepth="Depth2">
|
||||
<StackPanel Margin="16,8,16,0">
|
||||
<TextBlock Classes="Headline4" Text="Material Icons" />
|
||||
<TextBlock Classes="Subtitle1 Subheadline" TextWrapping="Wrap" Text="Material.Avalonia using Material.Icons.Avalonia and Material.Icons packages to provide icons for Material design. You can always use them freely in your application with Material.Avalonia!" />
|
||||
</StackPanel>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
|
||||
<styles:ColorZone Grid.Row="2" Padding="8" Mode="Standard" assists:ShadowAssist.ShadowDepth="Depth2">
|
||||
<controls:ColorZone Grid.Row="2" Padding="8" Mode="Standard" assists:ShadowAssist.ShadowDepth="Depth2">
|
||||
<Grid Margin="8" ColumnDefinitions="*,Auto,*,16,Auto">
|
||||
<styles:ColorZone Mode="Inverted" CornerRadius="32" BorderBrush="Transparent"
|
||||
<controls:ColorZone Mode="Inverted" CornerRadius="32" BorderBrush="Transparent"
|
||||
ToolTip.Tip="Enter to search, ignore case">
|
||||
<TextBox KeyDown="Search_OnKeyDown" Watermark="Search" Name="SearchBox" Classes="Solo"
|
||||
Text="{Binding SearchText}" Margin="0">
|
||||
@@ -97,12 +98,12 @@
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
|
||||
<TextBlock Grid.Column="1" Margin="16 0" Classes="Subtitle1"
|
||||
VerticalAlignment="Center" Text="Usage:"/>
|
||||
|
||||
<styles:ColorZone Grid.Column="2" Mode="Inverted" CornerRadius="32" BorderBrush="Transparent" >
|
||||
<controls:ColorZone Grid.Column="2" Mode="Inverted" CornerRadius="32" BorderBrush="Transparent" >
|
||||
<TextBox GotFocus="TextBox_OnGotFocus" IsReadOnly="True" Classes="Solo" Margin="0"
|
||||
Text="{Binding SelectedGroup.KindToCopy, FallbackValue='<avalonia:MaterialIcon Kind="" \/>'}">
|
||||
<TextBox.InnerRightContent>
|
||||
@@ -113,7 +114,7 @@
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
|
||||
<Grid Grid.Column="4" ColumnDefinitions="Auto,8,Auto" IsVisible="{Binding SelectedGroup, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<TextBlock Classes="Subtitle1"
|
||||
@@ -124,6 +125,6 @@
|
||||
Kind="{Binding SelectedGroup.KindValue}" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</styles:ColorZone>
|
||||
</controls:ColorZone>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -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:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.ListsDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Lists" />
|
||||
@@ -16,14 +17,14 @@
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="Lists0">
|
||||
<styles:Card Padding="0,4">
|
||||
<controls:Card Padding="0,4">
|
||||
<ListBox Width="300">
|
||||
<TextBlock Text="Item 1" />
|
||||
<TextBlock Text="Item 2" />
|
||||
<TextBlock Text="Item 3" />
|
||||
<TextBlock Text="Item 4" />
|
||||
</ListBox>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -37,6 +37,14 @@
|
||||
assists:DatePickerAssist.DateTimeFormat="\M\y \for\ma\t MMM dd, yyyy"></DatePicker>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
|
||||
<TextBlock Text="Multiple selection"/>
|
||||
<TextBlock Text="{Binding #DatePicker3.SelectedDate, FallbackValue=Not selected}" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="DatePicker3">
|
||||
<DatePicker Name="DatePicker3" Classes="multiselect"/>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -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:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.ProgressIndicatorDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Progress Indicator" />
|
||||
@@ -29,39 +30,39 @@
|
||||
<ProgressBar Value="{Binding Progress}" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ProgressIndicators4">
|
||||
<ProgressBar Value="{Binding Progress}" Classes="notransitions" />
|
||||
<ProgressBar Value="{Binding Progress}" Classes="no-transitions" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Circular progress bars" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar0">
|
||||
<ProgressBar Classes="Circle" Value="30" Margin="4" />
|
||||
<ProgressBar Classes="circular" Value="30" Margin="4" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar1">
|
||||
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<ProgressBar Classes="Circle" Value="60" />
|
||||
</styles:Card>
|
||||
<ProgressBar Classes="circular" Value="60" />
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar2">
|
||||
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<ProgressBar Classes="Circle" IsIndeterminate="True" />
|
||||
</styles:Card>
|
||||
<ProgressBar Classes="circular" IsIndeterminate="True" />
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar3">
|
||||
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<ProgressBar Classes="Circle" Value="{Binding Progress}" />
|
||||
</styles:Card>
|
||||
<ProgressBar Classes="circular" Value="{Binding Progress}" />
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar4">
|
||||
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
|
||||
<ProgressBar Classes="Circle notransitions" Value="{Binding Progress}" />
|
||||
</styles:Card>
|
||||
<ProgressBar Classes="circular no-transitions" Value="{Binding Progress}" />
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:pages="clr-namespace:Material.Demo.Pages"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.ScrollViewerDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="styles|Card">
|
||||
<Style Selector="controls|Card">
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
@@ -19,13 +20,13 @@
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="ScrollViewer with classic scrollbar" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ScrollViewer0">
|
||||
<styles:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
|
||||
<controls:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Visible"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
Classes="Classic">
|
||||
<pages:Home />
|
||||
</ScrollViewer>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
@@ -33,24 +34,24 @@
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ScrollViewer1">
|
||||
|
||||
|
||||
<styles:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
|
||||
<controls:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Visible"
|
||||
VerticalScrollBarVisibility="Visible">
|
||||
<pages:Home />
|
||||
</ScrollViewer>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="ScrollViewer with mini scrollbar" />
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ScrollViewer2">
|
||||
<styles:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
|
||||
<controls:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Visible"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
Classes="MiniBar">
|
||||
<pages:Home />
|
||||
</ScrollViewer>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:pages="clr-namespace:Material.Demo.Pages"
|
||||
xmlns:models="clr-namespace:Material.Demo.Models"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
|
||||
x:Class="Material.Demo.Pages.SideSheetDemo"
|
||||
x:DataType="models:SideSheetDemoViewModel">
|
||||
@@ -16,21 +17,21 @@
|
||||
<StackPanel Margin="16, 0">
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Side sheets" />
|
||||
|
||||
<styles:SideSheet
|
||||
<controls:SideSheet
|
||||
Name="SideSheet"
|
||||
Width="500" Height="560" BorderBrush="Black" BorderThickness="1"
|
||||
SideSheetDirection="Right"
|
||||
SideSheetOpened="{CompiledBinding SideInfoOpened}"
|
||||
SideSheetContent="{CompiledBinding Information}"
|
||||
SideSheetHeader="{CompiledBinding Information.Header}">
|
||||
<styles:SideSheet.SideSheetContentTemplate>
|
||||
<controls:SideSheet.SideSheetContentTemplate>
|
||||
<DataTemplate DataType="models:SideSheetData">
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6" Text="{CompiledBinding ContentHeader}"/>
|
||||
<TextBlock Text="{CompiledBinding ImportantInfos}" TextWrapping="Wrap"></TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</styles:SideSheet.SideSheetContentTemplate>
|
||||
</controls:SideSheet.SideSheetContentTemplate>
|
||||
<Panel>
|
||||
<pages:Home />
|
||||
<Button Classes="Icon" Width="36" Height="36"
|
||||
@@ -40,6 +41,6 @@
|
||||
IsVisible="{Binding !#SideSheet.SideSheetOpened}"
|
||||
Click="OpenSideInfoButton_OnClick" />
|
||||
</Panel>
|
||||
</styles:SideSheet>
|
||||
</controls:SideSheet>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -3,131 +3,261 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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"
|
||||
x:Class="Material.Demo.Pages.SlidersDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
x:Class="Material.Demo.Pages.SlidersDemo" >
|
||||
<StackPanel Margin="0, 0" >
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="StackPanel.Content Slider">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Style Selector="StackPanel.Content Slider" >
|
||||
<Setter Property="Maximum" Value="100" />
|
||||
<Setter Property="Minimum" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="StackPanel.Content TextBlock">
|
||||
<Style Selector="StackPanel.Content Slider:horizontal" >
|
||||
<Setter Property="Width" Value="300" />
|
||||
</Style>
|
||||
<Style Selector="StackPanel.Content TextBlock" >
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="16,0" />
|
||||
<Setter Property="Text" Value="{Binding $parent.Children[0].Content.Value}" />
|
||||
</Style>
|
||||
<Style Selector="StackPanel.Content">
|
||||
<Style Selector="StackPanel.Content" >
|
||||
<Setter Property="Margin" Value="4 2" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Sliders" />
|
||||
<Slider Classes="Discrete"
|
||||
TickFrequency="1"
|
||||
Value="100" />
|
||||
<WrapPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Regular sliders" />
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Slider (Material v1, legacy)" />
|
||||
|
||||
<!-- lol this one are not enabled snap to tick,
|
||||
when dragging thumb could contains a long numerics with decimal point. -->
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider0">
|
||||
<Slider />
|
||||
when dragging thumb could contains a long numerics with decimal point. -->
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider0" >
|
||||
<Slider Classes="material-v1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock MinWidth="120" />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider1">
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider1" >
|
||||
<Slider Classes="material-v1"
|
||||
IsSnapToTickEnabled="True"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider2">
|
||||
<Slider IsSnapToTickEnabled="True" Classes="Accent"
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider2" >
|
||||
<Slider Classes="material-v1 Accent"
|
||||
IsSnapToTickEnabled="True"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider3">
|
||||
<Slider IsEnabled="False" Value="20" />
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider3" >
|
||||
<Slider Classes="material-v1 Accent"
|
||||
IsEnabled="False" Value="20" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Modern slider" />
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider0">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Standard slider" />
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider0" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern"
|
||||
Classes=""
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider1">
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider1" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Accent"
|
||||
Classes=" Accent"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider2">
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider2" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Ticks"
|
||||
Classes=" Ticks"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider3">
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider3" >
|
||||
<Slider IsEnabled="False" Value="20"
|
||||
IsSnapToTickEnabled="True"
|
||||
Classes="Modern Ticks"
|
||||
TickFrequency="1" />
|
||||
Classes=" Ticks"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Sliders with bubble (Discrete)" />
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider0">
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Discrete slider" />
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider0" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Discrete"
|
||||
Classes="material-v1 Discrete"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider1">
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider1" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Discrete"
|
||||
Classes=" Discrete"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider2">
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider2" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Discrete Accent"
|
||||
Classes=" Discrete Accent"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider3">
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider3" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Discrete Accent Ticks"
|
||||
Classes=" Discrete Accent Ticks"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Vertical sliders" />
|
||||
<WrapPanel>
|
||||
<WrapPanel.Styles>
|
||||
<Style Selector="Slider" >
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
<Setter Property="Width" Value="NaN" />
|
||||
<Setter Property="Height" Value="300" />
|
||||
</Style>
|
||||
</WrapPanel.Styles>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Slider (Material v1, legacy)" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider0" >
|
||||
<Slider Classes="material-v1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider1" >
|
||||
<Slider Classes="material-v1"
|
||||
IsSnapToTickEnabled="True"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider2" >
|
||||
<Slider Classes="material-v1 Accent"
|
||||
IsSnapToTickEnabled="True"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider3" >
|
||||
<Slider Classes="material-v1 Accent"
|
||||
IsEnabled="False" Value="20" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Standard slider" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider0" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider1" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Accent"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider2" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Ticks"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider3" >
|
||||
<Slider IsEnabled="False" Value="20"
|
||||
IsSnapToTickEnabled="True"
|
||||
Classes="Modern Ticks"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Classes="Headline6 Subheadline2" Text="Discrete slider" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider0" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="material-v1 Discrete"
|
||||
TickFrequency="1" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider1" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Discrete"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider2" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Discrete Accent"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<StackPanel Classes="Content" Orientation="Horizontal" >
|
||||
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider3" >
|
||||
<Slider IsSnapToTickEnabled="True"
|
||||
Classes="Modern Discrete Accent Ticks"
|
||||
TickFrequency="10" />
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:assist="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.TogglesDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
<TextBlock Classes="Headline4 Subheadline" Text="Toggles" />
|
||||
@@ -140,7 +141,7 @@
|
||||
</StackPanel.Styles>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RadioButtonsCard0">
|
||||
<styles:Card Padding="0" InsideClipping="True">
|
||||
<controls:Card Padding="0" InsideClipping="True">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Classes="Button" GroupName="3"
|
||||
Content="{avalonia:MaterialIconExt Kind=FormatAlignLeft}" />
|
||||
@@ -153,11 +154,11 @@
|
||||
<RadioButton Classes="Button" GroupName="3"
|
||||
Content="{avalonia:MaterialIconExt Kind=FormatAlignJustify}" />
|
||||
</StackPanel>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
|
||||
<showMeTheXaml:XamlDisplay UniqueId="RadioButtonsCard1">
|
||||
<styles:Card Padding="0" InsideClipping="True" Margin="0,16,0,0">
|
||||
<controls:Card Padding="0" InsideClipping="True" Margin="0,16,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Classes="Button Accent" GroupName="4"
|
||||
Content="{avalonia:MaterialIconExt Kind=FormatAlignLeft}" />
|
||||
@@ -168,7 +169,7 @@
|
||||
<RadioButton Classes="Button Accent" GroupName="4"
|
||||
Content="{avalonia:MaterialIconExt Kind=FormatAlignJustify}" />
|
||||
</StackPanel>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</showMeTheXaml:XamlDisplay>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
|
||||
x:Class="Material.Demo.Pages.TreeViewsDemo">
|
||||
<StackPanel Margin="16, 0">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="styles|Card.ChildDemo">
|
||||
<Style Selector="controls|Card.ChildDemo">
|
||||
<Setter Property="Width" Value="320" />
|
||||
<Setter Property="Height" Value="320" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
<WrapPanel>
|
||||
<!-- Demos -->
|
||||
<styles:Card Classes="ChildDemo">
|
||||
<controls:Card Classes="ChildDemo">
|
||||
<!-- TODO: StackPanel could ignore height of parent. -->
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<TextBlock Classes="Headline6" Margin="8" Text="Operation systems: " />
|
||||
@@ -57,6 +58,15 @@
|
||||
<TextBlock Text="Linux" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
<avalonia:MaterialIcon Kind="Android" />
|
||||
<TextBlock Text="Android" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
@@ -66,14 +76,7 @@
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
<avalonia:MaterialIcon Kind="LinuxMint" />
|
||||
<TextBlock Text="Mint Linux" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
@@ -90,14 +93,7 @@
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
<avalonia:MaterialIcon Kind="Ubuntu" />
|
||||
<TextBlock Text="Ubuntu" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
@@ -105,11 +101,30 @@
|
||||
<TextBlock Text="Debian" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
<avalonia:MaterialIcon Kind="Ubuntu" />
|
||||
<TextBlock Text="Ubuntu" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
<TreeViewItem>
|
||||
<TreeViewItem.Header>
|
||||
<Grid ColumnDefinitions="Auto, 8, *">
|
||||
<avalonia:MaterialIcon Kind="LinuxMint" />
|
||||
<TextBlock Text="Mint Linux" Grid.Column="2" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
<TreeViewItem Header="Pop!_OS"/>
|
||||
<TreeViewItem Header="Lubuntu"/>
|
||||
<TreeViewItem Header="Zorin OS"/>
|
||||
</TreeViewItem>
|
||||
</TreeViewItem>
|
||||
</TreeViewItem>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
</styles:Card>
|
||||
</controls:Card>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -1,4 +1,5 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Animation.Easings;
|
||||
using Avalonia.Controls;
|
||||
using ShowMeTheXaml;
|
||||
|
||||
@@ -10,7 +11,9 @@ namespace Material.Demo {
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
// yet and stuff might break.
|
||||
public static void Main(string[] args) {
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Ripple.Ripple.Easing = new LinearEasing();
|
||||
BuildAvaloniaApp().Start(AppMain, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,19 +11,10 @@ namespace Material.Demo.ViewModels
|
||||
{
|
||||
public class DialogDemoViewModel : ViewModelBase
|
||||
{
|
||||
private DialogDemoItemViewModel[] _standaloneDialogItems;
|
||||
private TimeSpan _previousTimePickerResult = TimeSpan.Zero;
|
||||
private DateTime _previousDatePickerResult = DateTime.Now;
|
||||
|
||||
public DialogDemoItemViewModel[] StandaloneDialogItems
|
||||
{
|
||||
get => _standaloneDialogItems;
|
||||
private set
|
||||
{
|
||||
_standaloneDialogItems = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public DialogDemoItemViewModel[] StandaloneDialogItems { get; }
|
||||
|
||||
public DialogDemoViewModel()
|
||||
{
|
||||
@@ -163,7 +154,7 @@ namespace Material.Demo.ViewModels
|
||||
new TextFieldBuilderParams
|
||||
{
|
||||
HelperText = "* Required",
|
||||
Classes = "Outline",
|
||||
Classes = "outline",
|
||||
Label = "Account",
|
||||
MaxCountChars = 24,
|
||||
Validater = ValidateAccount,
|
||||
@@ -171,7 +162,7 @@ namespace Material.Demo.ViewModels
|
||||
new TextFieldBuilderParams
|
||||
{
|
||||
HelperText = "* Required",
|
||||
Classes = "Outline",
|
||||
Classes = "outline",
|
||||
Label = "Password",
|
||||
MaxCountChars = 64,
|
||||
FieldKind = TextFieldKind.Masked,
|
||||
@@ -206,12 +197,12 @@ namespace Material.Demo.ViewModels
|
||||
|
||||
private Tuple<bool,string> ValidateAccount(string text)
|
||||
{
|
||||
var result = text?.Length > 5;
|
||||
var result = text.Length > 5;
|
||||
return new Tuple<bool, string>(result, result ? "" : "Too few account name.");
|
||||
}
|
||||
private Tuple<bool, string> ValidatePassword(string text)
|
||||
{
|
||||
var result = text?.Length >= 1;
|
||||
var result = text.Length >= 1;
|
||||
return new Tuple<bool, string>(result, result ? "" : "Field should be filled.");
|
||||
}
|
||||
|
||||
@@ -226,13 +217,14 @@ namespace Material.Demo.ViewModels
|
||||
Width = 400,
|
||||
TextFields = new TextFieldBuilderParams[]
|
||||
{
|
||||
new TextFieldBuilderParams
|
||||
new ()
|
||||
{
|
||||
Label = "Folder name",
|
||||
MaxCountChars = 256,
|
||||
Validater = ValidatePassword,
|
||||
DefaultText = "Folder1"
|
||||
},
|
||||
DefaultText = "Folder1",
|
||||
HelperText = "* Required"
|
||||
}
|
||||
},
|
||||
DialogButtons = new []
|
||||
{
|
||||
@@ -266,11 +258,15 @@ namespace Material.Demo.ViewModels
|
||||
Borderless = true,
|
||||
StartupLocation = WindowStartupLocation.CenterOwner,
|
||||
ImplicitValue = _previousTimePickerResult,
|
||||
PositiveButton = new DialogButton
|
||||
DialogButtons = new[]
|
||||
{
|
||||
Content = "CONFIRM",
|
||||
Result = "confirm"
|
||||
},
|
||||
new DialogButton
|
||||
{
|
||||
Content = "CONFIRM",
|
||||
Result = "confirm",
|
||||
IsPositive = true
|
||||
}
|
||||
}
|
||||
}).ShowDialog(Program.MainWindow);
|
||||
|
||||
yield return $"Result: {result.GetResult}";
|
||||
@@ -290,11 +286,15 @@ namespace Material.Demo.ViewModels
|
||||
Borderless = true,
|
||||
StartupLocation = WindowStartupLocation.CenterOwner,
|
||||
ImplicitValue = _previousDatePickerResult,
|
||||
PositiveButton = new DialogButton
|
||||
DialogButtons = new[]
|
||||
{
|
||||
Content = "CONFIRM",
|
||||
Result = "confirm"
|
||||
},
|
||||
new DialogButton
|
||||
{
|
||||
Content = "CONFIRM",
|
||||
Result = "confirm",
|
||||
IsPositive = true
|
||||
}
|
||||
}
|
||||
}).ShowDialog(Program.MainWindow);
|
||||
|
||||
yield return $"Result: {result.GetResult}";
|
||||
|
||||
Reference in New Issue
Block a user