C#在WPF中编辑XAML文件

时间:2019-02-15 02:57:47

标签: c# xml wpf xaml

我正在尝试为正在使用C#Windows窗体工作的应用程序编辑graphics.xaml文件,但到目前为止,我尝试过的所有方法均未起作用。如何使用特定键在属性内编辑值?

<Style x:Key="PhotoStyle" TargetType="Image">
    <Setter Property="Image.Margin" Value="0,10,0,10" />
    <Setter Property="Image.HorizontalAlignment" Value="Center" />
    <Setter Property="Image.VerticalAlignment" Value="Center" />
    <Setter Property="Image.MaxWidth" Value="300" />
    <Setter Property="Image.MaxHeight" Value="300" />
</Style>
<Style x:Key="IconStyle" TargetType="Image">
    <Setter Property="Image.Margin" Value="0,10,0,10" />
    <Setter Property="Image.HorizontalAlignment" Value="Center" />
    <Setter Property="Image.VerticalAlignment" Value="Center" />
    <Setter Property="Image.MaxWidth" Value="80" />
    <Setter Property="Image.MaxHeight" Value="80" />
    <Setter Property="Image.Source" Value="..\Images\Grant.png" />
</Style>

我想使用Windows窗体内textBox内的值来编辑“ IconStyle”键内的Property =“ Image.MaxWidth”的值。预先感谢!

0 个答案:

没有答案