更新客户端渲染,更新了壳
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<Page
|
||||
x:Class="Wpf.Ui.Demo.Console.Views.Pages.DashboardPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Wpf.Ui.Demo.Console.Views.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="DashboardPage"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
mc:Ignorable="d"
|
||||
>
|
||||
<Grid Margin="42" VerticalAlignment="Top">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Grid.Column="0"
|
||||
Click="OnBaseButtonClick"
|
||||
Content="Click me!"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
/>
|
||||
<TextBlock x:Name="CounterTextBlock" Grid.Column="1" Margin="12,0,0,0" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,34 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using Wpf.Ui.Demo.Console.Utilities;
|
||||
|
||||
namespace Wpf.Ui.Demo.Console.Views.Pages;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for DashboardPage.xaml
|
||||
/// </summary>
|
||||
public partial class DashboardPage
|
||||
{
|
||||
private int _counter = 0;
|
||||
|
||||
public DashboardPage()
|
||||
{
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
|
||||
CounterTextBlock.SetCurrentValue(System.Windows.Controls.TextBlock.TextProperty, _counter.ToString());
|
||||
|
||||
this.ApplyTheme();
|
||||
}
|
||||
|
||||
private void OnBaseButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CounterTextBlock.SetCurrentValue(
|
||||
System.Windows.Controls.TextBlock.TextProperty,
|
||||
(++_counter).ToString()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<Page
|
||||
x:Class="Wpf.Ui.Demo.Console.Views.Pages.DataPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Wpf.Ui.Demo.Console.Views.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:Wpf.Ui.Demo.Console.Models"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="DataPage"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
mc:Ignorable="d"
|
||||
>
|
||||
<Grid Margin="42">
|
||||
<ui:VirtualizingItemsControl
|
||||
x:Name="ColorsItemsControl"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
VirtualizingPanel.CacheLengthUnit="Item"
|
||||
>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type models:DataColor}">
|
||||
<ui:Button
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="2"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Appearance="Secondary"
|
||||
Background="{Binding Color, Mode=OneWay}"
|
||||
FontSize="25"
|
||||
Icon="Fluent24"
|
||||
/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ui:VirtualizingItemsControl>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,49 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using Wpf.Ui.Demo.Console.Models;
|
||||
using Wpf.Ui.Demo.Console.Utilities;
|
||||
|
||||
namespace Wpf.Ui.Demo.Console.Views.Pages;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for DataView.xaml
|
||||
/// </summary>
|
||||
public partial class DataPage
|
||||
{
|
||||
public ObservableCollection<DataColor> ColorsCollection = [];
|
||||
|
||||
public DataPage()
|
||||
{
|
||||
InitializeData();
|
||||
InitializeComponent();
|
||||
|
||||
ColorsItemsControl.ItemsSource = ColorsCollection;
|
||||
|
||||
this.ApplyTheme();
|
||||
}
|
||||
|
||||
private void InitializeData()
|
||||
{
|
||||
var random = new Random();
|
||||
|
||||
for (int i = 0; i < 8192; i++)
|
||||
{
|
||||
ColorsCollection.Add(
|
||||
new DataColor
|
||||
{
|
||||
Color = new SolidColorBrush(
|
||||
Color.FromArgb(
|
||||
(byte)200,
|
||||
(byte)random.Next(0, 250),
|
||||
(byte)random.Next(0, 250),
|
||||
(byte)random.Next(0, 250)
|
||||
)
|
||||
),
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<Page
|
||||
x:Class="Wpf.Ui.Demo.Console.Views.Pages.SettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Wpf.Ui.Demo.Console.Views.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="SettingsPage"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
mc:Ignorable="d"
|
||||
>
|
||||
<StackPanel Margin="42">
|
||||
<TextBlock FontSize="20" FontWeight="Medium" Text="Personalization" />
|
||||
<TextBlock Margin="0,12,0,0" Text="Theme" />
|
||||
<RadioButton
|
||||
x:Name="LightThemeRadioButton"
|
||||
Margin="0,12,0,0"
|
||||
Checked="OnLightThemeRadioButtonChecked"
|
||||
Content="Light"
|
||||
GroupName="themeSelect"
|
||||
/>
|
||||
<RadioButton
|
||||
x:Name="DarkThemeRadioButton"
|
||||
Margin="0,8,0,0"
|
||||
Checked="OnDarkThemeRadioButtonChecked"
|
||||
Content="Dark"
|
||||
GroupName="themeSelect"
|
||||
/>
|
||||
<TextBlock Margin="0,24,0,0" FontSize="20" FontWeight="Medium" Text="About WPF UI - Simple Demo" />
|
||||
<TextBlock x:Name="AppVersionTextBlock" Margin="0,12,0,0" />
|
||||
</StackPanel>
|
||||
</Page>
|
||||
@@ -0,0 +1,49 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Demo.Console.Utilities;
|
||||
|
||||
namespace Wpf.Ui.Demo.Console.Views.Pages;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for SettingsPage.xaml
|
||||
/// </summary>
|
||||
public partial class SettingsPage
|
||||
{
|
||||
public SettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
AppVersionTextBlock.Text = $"WPF UI - Simple Demo - {GetAssemblyVersion()}";
|
||||
|
||||
if (Appearance.ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Dark)
|
||||
{
|
||||
DarkThemeRadioButton.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LightThemeRadioButton.IsChecked = true;
|
||||
}
|
||||
|
||||
this.ApplyTheme();
|
||||
}
|
||||
|
||||
private void OnLightThemeRadioButtonChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Appearance.ApplicationThemeManager.Apply(ApplicationTheme.Light);
|
||||
}
|
||||
|
||||
private void OnDarkThemeRadioButtonChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Appearance.ApplicationThemeManager.Apply(ApplicationTheme.Dark);
|
||||
}
|
||||
|
||||
private string GetAssemblyVersion()
|
||||
{
|
||||
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString()
|
||||
?? string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user