c# - Property Changed Notification Binding to a Static Dictionary? -
Together with this problem the circles become round.
I have 2 comboboxes User makes a selection on the first combo box & amp; 2 ComboBox Displays Option 1 on the basis of selection
I am binding on a constant dictionary
In my thoughts model I have another public property that raises the INPC on the static dictionary. In the UI, changes are not displayed. I have not found any errors in the output window, am I missing something? ComboBox
; String, string & gt;
It worked fine under .NET4.0. As soon as the user installed .NET4.5 machines, this behavior started with this 1 ComboBox bound for a dictionary ...
Properties:
Private static Dictionary & LT; String, string & gt; _ModelArticleTypeCodeToChangeTitleMap; Public stable dictionary & lt; String, string & gt; ModelArticleTypeCodeToChangeTitleMap {Get {Return _ModelArticleTypeCodeToChangeTelTemp; } Set {_ModelArticleTypeCodeToChangeTitleMap = Value; }} // The default ArticleTypeCodeToTitleMapFilteredByCategory dictionary will be on the entire list (as a category has initially been selected) Private Dictionary & LT; String, string & gt; _ModelArticleTypeCodeToTitleMapFilteredByCategory = ModelArticleTypeCodeToTitleMap; Public dictionary & lt; String, string & gt; ModelArticleTypeCodeToTitleMapFilteredByCategory {Get {Back _ModelArticleTypeCodeToChangeTitleMap; } Set {_ModelArticleTypeCodeToChangeTitleMap = Value; OnPropertyChanged ("ModelArticleTypeCodeToChangeTitleMap"); }}
Xaml:
& lt; ComboBox DisplayMemberPath = "Value" HorizontalAlignment = "left", converter = {StaticResource invertBoolConverter}} "IsSynchronizedWithCurrentItem =" True "ItemsSource =" {Binding Path = ModelArticleCategoryToTitleMap, Mode = TwoWay} "SelectedValue =" {Binding ModelSelectedArticleCategory} "SelectedValuePath =" Key "/> comboBox ItemsSource =" {Binding Path = ModelArticleTypeCodeToChangeTitleMap, Mode = TwoWay, UpdateSourceTrigger = Property ChangeJoin} "IsEnabled =" {Binding IsEditModeTitleReadOnly, converter = {Static Resources InvertBolcounter}} "IsSynchronizedWithCurrentItem =" True " DisplayMemberPath = "Value" SelectedValuePath = "Key" SelectedValue = "{Binding ModelSelectedArticleTypeCode}" Text = "{Binding ModelEnteredTitle}" TabIndex = "1" / & g After the text "itemprop =" lesson ">
Ok, strobel @mike thanks was due to the implementation of INOTifyProperty I am not working with a static property. I raised the incident on the incident and property setter by changing a property written by a steady speech:
Preform >> INOTifyPropertyChanged event for stable properties! Public Static Event EventHandler & lt; Property ChangeEndEgages & gt; StaticPropertyChanged; Private Static Zero NotifyStaticPropertyChanged (String Properties) {if (! StaticPropertyChanged = Faucet) {StaticPropertyChanged (Zero, New PropertyChangedEventArgs (Property)); }} Property:
Private dictionary & lt; String, string & gt; _ModelArticleTypeCodeToTitleMapFilteredByCategory = ModelArticleTypeCodeToTitleMap; Public dictionary & lt; String, string & gt; ModelArticleTypeCodeToTitleMapFilteredByCategory {Get {Back _ModelArticleTypeCodeToChangeTitleMap; } Set {_ModelArticleTypeCodeToChangeTitleMap = Value; NotifyStaticPropertyChanged ("ModelArticleTypeCodeToChangeTitleMap"); }}
Comments
Post a Comment