mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-20 00:16:35 +08:00
misc: revert DynamicResource Copy Button.
This commit is contained in:
@@ -311,20 +311,11 @@
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ColorResource">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText1}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="StaticResource" />
|
||||
<Button
|
||||
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText2}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="DynamicResource" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
@@ -55,20 +55,11 @@
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:VariableItemViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:VariablesDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText1}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="StaticResource" />
|
||||
<Button
|
||||
Command="{Binding $parent[pages:VariablesDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText2}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="DynamicResource" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Command="{Binding $parent[pages:VariablesDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
@@ -70,20 +70,11 @@
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText1}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="StaticResource" />
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText2}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="DynamicResource" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -143,20 +134,11 @@
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText1}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="StaticResource" />
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText2}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="DynamicResource" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
@@ -49,20 +49,11 @@
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText1}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="StaticResource" />
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText2}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="DynamicResource" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -101,20 +92,11 @@
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText1}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="StaticResource" />
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText2}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}"
|
||||
ToolTip.Tip="DynamicResource" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
@@ -126,13 +126,8 @@ public partial class ColorResource : ObservableObject
|
||||
[ObservableProperty] private string? _description;
|
||||
[ObservableProperty] private string? _pairWith;
|
||||
|
||||
public string CopyText1 =>
|
||||
public string CopyText =>
|
||||
$"""
|
||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public string CopyText2 =>
|
||||
$"""
|
||||
<DynamicResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
}
|
||||
@@ -135,16 +135,11 @@ public partial class ColorItemViewModel : ObservableObject
|
||||
[ObservableProperty] private string? _colorResourceKey;
|
||||
[ObservableProperty] private string? _hex;
|
||||
|
||||
public string CopyText1 =>
|
||||
public string CopyText =>
|
||||
$"""
|
||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public string CopyText2 =>
|
||||
$"""
|
||||
<DynamicResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light,
|
||||
int index)
|
||||
{
|
||||
@@ -201,16 +196,11 @@ public partial class ShadowItemViewModel : ObservableObject
|
||||
[ObservableProperty] private string? _resourceKey;
|
||||
[ObservableProperty] private string? _boxShadowValue;
|
||||
|
||||
public string CopyText1 =>
|
||||
public string CopyText =>
|
||||
$"""
|
||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public string CopyText2 =>
|
||||
$"""
|
||||
<DynamicResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public ShadowItemViewModel(string shadowDisplayName, BoxShadows boxShadows, string resourceKey)
|
||||
{
|
||||
ShadowDisplayName = shadowDisplayName;
|
||||
|
||||
@@ -76,16 +76,11 @@ public partial class VariableItemViewModel : ObservableObject
|
||||
[ObservableProperty] private string? _description;
|
||||
[ObservableProperty] private string? _value;
|
||||
|
||||
public string CopyText1 =>
|
||||
public string CopyText =>
|
||||
$"""
|
||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public string CopyText2 =>
|
||||
$"""
|
||||
<DynamicResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public VariableItemViewModel(string description, object value, string resourceKey)
|
||||
{
|
||||
ResourceKey = resourceKey;
|
||||
|
||||
Reference in New Issue
Block a user