简体   繁体   中英

How to refresh user control on the button click in WPF

I am showing user control on the popup. Like as:

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

And showing in the grid control like as:

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

And now i want to refresh data of this user control on the button click for that We will show updated functionality on this page. How to fix this problem? If possible please guide me?

If following MVVM

Add a button in view, bind a command to it and fire property changed for TimeLogModel in command handler.

if not.

In click handler raise property changed for TimeLogModel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM