如何在WPF中单击按钮单击时刷新用户控件

时间:2016-05-05 14:16:33

标签: c# wpf

我在弹出窗口中显示用户控件。像:

 xmlns:TimelogCustomControl="clr-namespace:TechTouch.CustomControl"

并在网格控件中显示如下:

<Grid Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="2">
                                        <TimelogCustomControl:OnDutyPopUp  Value="{Binding TimeLogModel.HeaderDutyText,Mode=TwoWay}"   VerticalAlignment="Top"></TimelogCustomControl:OnDutyPopUp>
                                        </Grid>

现在我想在按钮点击时刷新此用户控件的数据,我们将在此页面上显示更新的功能。如何解决这个问题?如果可能请指导我?

1 个答案:

答案 0 :(得分:1)

如果关注MVVM

在视图中添加一个按钮,将命令绑定到该按钮并更改fire属性 命令处理程序中的TimeLogModel。

如果没有。

在TimeLogModel中更改了click handler raise属性。