我有一个简单的WPF-MVVM应用程序,您可以在其中创建和编辑记录。类似于这样:
我不想使用两个不同的表单。我希望只使用一个表单,并创建一个动态菜单,在其中可以选择哪些按钮可见。
现在的XAML大致如下:
什么是最好的方法来做到这一点?
我不想使用两个不同的表单。我希望只使用一个表单,并创建一个动态菜单,在其中可以选择哪些按钮可见。
现在的XAML大致如下:
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button MinWidth="93" Command="{Binding CreateCommand}>
Create
</Button>
<Button MinWidth="93" Command="{Binding EditCommand}>
Edit
</Button>
<Button MinWidth="93" Command="{Binding DeleteCommand}>
Delete
</Button>
<Button MinWidth="93" Command="{Binding CancelCommand}>
Cancel
</Button>
</StackPanel>
什么是最好的方法来做到这一点?