Questions tagged [propertychanged]

221 questions
1
vote
1 answer

Prism + MVVM + Access Keys + UpdateSourceTrigger="LostFocus" -- This doesn't let me save an updated textbox without first losing focus

Not really sure how to tackle this issue: I have a "Save" button that has access keys attached to it... but, if I type something into a textbox and press the access keys to save, the textbox doesn't update my viewmodel because it never lost focus.…
myermian
  • 31,823
  • 24
  • 123
  • 215
1
vote
0 answers

PropertyChangedCallback called before Binding/ViewModel updates

I am currently building a control library for WPF, WinUI3 and UWP. I use custom ContentControls for my controls with DependencyProperties. On some DependencyProperties (e.g. IsChecked) I have to use a PropertyChangedCallback to update some UI…
IcySnex
  • 33
  • 5
1
vote
0 answers

WPF After ICommand INotifyPropertyChanged is called, but not updating UI [MVVM]

When the View is initialized, their standard value "VM", definied in the ViewModel, is updated trough the Model and updated in the View. However, when the ICommand NavigationCommand is triggered, the code in the OnNavigationCommand method executes,…
1
vote
0 answers

WPF UserControl: PropertyChangedCallback is not called when set value in trigger

There is several custom controls NumericBox with corresponding radio-buttons in the ContentControl template. ContentControl is content of popup, what is part of DataGridTemplateColumn CellTemplate. When radio-button is checked, Value property of…
1
vote
2 answers

How to bind an event to the property IsVisible of a ContentView?

I've created a control in Xamarin.Forms, allowing me to display a reusable error view, with ContentView and Lottie animations. My view contains: the Lottie animation, 2 Labels (a title and a description) and a "Retry" Button. The Lotie animation is…
Gold.strike
  • 1,269
  • 13
  • 47
1
vote
1 answer

How to Raise Property Changed in Derived Classes?

How do I raise PropertyChanged for SomeProperty in class B? This example does not compile since PropertyChanged is not accessible this way... public class A : INotifyPropertyChanged { public event PropertyChangedEventHandler…
Jogge
  • 1,654
  • 12
  • 36
1
vote
1 answer

MVVM - binding to aggregated property

I have following viewmodels: public class ViewModel: INotifyPropertyChanged { public ObservableCollection Items { get; set; } ... } public class Item: INotifyPropertyChanged { public SubItem A { get; set; } public SubItem B {…
Sinatr
  • 20,892
  • 15
  • 90
  • 319
1
vote
1 answer

Update generic property of generic class?

I'm quite new at C# Generic Classes so I don't know if we can update the generic property of a generic class dynamically? Let say I have a class A { long id; long count; } Can we write an extension that update the given property by 1 so A.AddOne(a…
ByulTaeng
  • 1,269
  • 1
  • 21
  • 40
1
vote
0 answers

MyProperty not updated in PropertyChangedCallBack

Is there a CallBack After PropertyChangedCallBack ? because in the PropertyChangedCallBack the change hasn't been made yet. In the example below after I set MyProperty and when Foo() is being called, MyProperty still got the old value in Foo(). I…
ihisham
  • 248
  • 1
  • 10
1
vote
2 answers

WPF - Notify ViewModel when object property is changed

I'm new to WPF and MVVM (and programming in general), so sorry in advance for noobish question, but i really want to make this work in MVVM I have a ObservableCollection class and ViewModel where i use it, now i want to calculate OreMineTotal and…
ostomac
  • 35
  • 1
  • 6
1
vote
1 answer

Xamarin.Forms Custom DateTime BindableProperty BindingPropertyChangedDelegate

I have been working through Ed Snider's book, Mastering Xamarin.Forms. Page 71 instructs to create a class, DatePickerEmtryCell, that inherits from EntryCell. It shows to add the following DateTime BindableProperty, but this method is now…
user1667474
  • 819
  • 6
  • 24
  • 37
1
vote
0 answers

WPF - binding to user control's Dependency property doesn't work without UpdateSourceTrigger

I have a reusable UserControl for selecting language using combobox with DependencyProperty SelectedCulture. Then I have another control with list of users displayed in a DataGrid using UsersViewModel containing collection of UserViewModel. One…
1
vote
1 answer

DataGridColumn not updating on PropertyChanged

My DataGrid is not updating the values in my ObservableCollection when a property is changed (it does show the initial values). I've looked over many other SO articles and did not find my problem so far. I'm using the following XAML
MatthiasVC
  • 13
  • 5
1
vote
0 answers

ScrollViewers ScrollBarVisibility dont get updated

I have multiple expanders, where only one should be expanded at a time. I implemented this, using this answer. The problem appears when a ScrollViewer with a VerticalScrollBar (Visibility Auto) is added around these Expanders. Problem Example: 3…
JoshuadV
  • 194
  • 8
1
vote
2 answers

WPF - How to monitor datagrid selecteditem property change

I am creating an application where I'm following the MVVM pattern (as best as I can), and I am using Prism to make that easier. I have a view where the user can edit one cell, and in this cell, choose a value from a ComboBox. I would like to monitor…
Starwop
  • 103
  • 2
  • 12