« first day (1086 days earlier)      last day (3063 days later) » 

12:13 AM
Another question
Which approach is better to use:
1. In XAML: {Binding Color, UpdateSourceTrigger=PropertyChanged}"
2. In code: self.RaisePropertyChanged("Color")
Oh, I get it. The modes of binding may differ to default for different properties and elements.
Then, I use: {Binding Color} and Binding works well.
 
right... I think
 
12:36 AM
So, RaisePropertyChanged from code need use, when in the property there only method get, or when UpdateSourceTrigger not equal to PropertyChanged by Default?
 
You are conflating two concepts
You raise PropertyChanged when the bound properties value has changed from a non-UI source
UpdateSourceTrigger dictates when the bound property is updated to match the current UI value
some of the rest of what you said just didn't make any sense at all
especially the bit about read only properties
 
Thanks, that sounds logical. I'm still not sure I understand correctly how it works. In my example:
        <Button Command="{Binding OpenFileCommand}" Margin="10" Content=" Click  Me "> </Button>
        <TextBlock Grid.Column="1" Margin="10" Text="{Binding Path}" FontSize="16"></TextBlock>
and .fs:
    let simpleCommand = self.Factory.CommandSync(DoSimpleCommand)

    let OpenFileDialog() =
        if dlg.ShowDialog().Value then
            path.Value <- dlg.FileName
            records <- Record.Get(path.Value)
            index <- defaultIndex
            visibility.Value <- false
            text.Value <- defaultText
            self.RaisePropertyChanged("Record")
        ()
    let openCommand = self.Factory.CommandSync(OpenFileDialog)
    member self.OpenFileCommand = openCommand
member self.Path with get() = path.Value
                  and set(value) =  path.Value <- value
I don`t use self.RaisePropertyChanged("Path"), but all work fine.
 
1:05 AM
Now I, think, understand. RaisePropertyChanged need raise, when changed some property from source, but not the source itself.
 
 
13 hours later…
2:07 PM
Hi
Best way to use and switch between user control in WPF MVVM in big project?
 
 
5 hours later…
7:24 PM
1
Q: Select ListViewItem when child element has focus UWP

Real WorldI'm writing a Universal Windows App and I have a ListView where the ListViewItems contain a TextBox and a Button. When I click in the text box I would like that ListViewItem to become selected. I've found solutions for WPF but Style.Triggers isn't available in UWP. Can anyone point me to the corr...

 

« first day (1086 days earlier)      last day (3063 days later) »