Samsung / TizenFX

C# Device APIs for Tizen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NUI Wrong Property Changed notify

idkiller opened this issue · comments

Duplicated PropertyChanged event

public event PropertyChangedEventHandler PropertySet;

public event PropertyChangedEventHandler PropertyChanged;

The two events have the same purpose, but are used in different places, and the associated methods are different. As a result, the bottom problem or various other problems occur, and people who use the API become confused.

Wrong changed notify

public Color BackgroundColor
{
get
{
Color temp = (Color)GetValue(BackgroundColorProperty);
return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
}
set
{
if (viewStyle != null)
{
viewStyle.BackgroundImage = null;
viewStyle.BackgroundColor = value;
}
else
{
SetValue(BackgroundColorProperty, value);
}
NotifyPropertyChanged();
}
}

if viewStyle is not null, value set the BackgroundColor of viewStyle but do not firePropertyChangedevent that originally triggered inSetValue`.
it makes bindings in xaml or property changed event not working properly.

This happens also in many other places (like following properties)

  • BackgroundImage
  • BackgroundImageBorder
  • Opacity
  • Color

and SetProperty method also don't fire PropertyChanged event. (In following properties)

  • TooltipText
  • PositionUsesAnchorPoint
  • AnchorPoint
  • PaddingEX

some property like Layout don't fire event in specific case.

if (value != null)
{
// Existing layout being replaced so copy over margin and padding values.
value.Margin = _layout.Margin;
value.Padding = _layout.Padding;
}

Many properties not covered here do not fire PropertyChanged events at all, or only in certain situations.

In my opinion, PropertyChanged, PropertySet must be unified, and what happens when a Property is set must be performed in the PropertyChanged event when it is a BindableProperty.

The code is getting too complicated because things that happen when the property is changed are inconsistent.

Hello, I'm checking this issue.

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days