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