* Change ControlState propagation sequence
* Remove setting border property in default switch style
This fixes an error of the following code,
```
protected override void OnCreate()
{
//...
var button = new Switch();
button.SelectedChanged += OnSelected;
root.Add(button);
}
void OnSelected(object target, SelectedChangedEventArgs args)
{
if (args.IsSelected)
{
(target as Switch).IsSelected = false;
}
}
```
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
}
slidingAnimation.Clear();
- slidingAnimation.AnimateTo(thumb, "PositionX", track.Size.Width - thumb.Size.Width - thumb.Position.X);
+ slidingAnimation.AnimateTo(thumb, "PositionX", switchButton.IsSelected ? track.Size.Width - thumb.Size.Width : 0);
slidingAnimation.EndAction = Animation.EndActions.StopFinal;
slidingAnimation.Play();
}
<!--Switch-->
<c:SwitchStyle x:Key="Switch" Size="96, 60">
<c:Switch.Track>
- <b:ImageViewStyle Size="96, 60" WidthResizePolicy="Fixed" HeightResizePolicy="Fixed" Border="30, 30, 30, 30">
+ <b:ImageViewStyle Size="96, 60" WidthResizePolicy="Fixed" HeightResizePolicy="Fixed">
<b:ImageViewStyle.ResourceUrl>
<b:Selector x:TypeArguments="x:String" Normal="{nx:NUIResourcePath nui_component_default_switch_track_n.png}" Selected="{nx:NUIResourcePath nui_component_default_switch_track_s.png}" Disabled="{nx:NUIResourcePath nui_component_default_switch_track_d.png}" DisabledSelected="{nx:NUIResourcePath nui_component_default_switch_track_ds.png}" />
</b:ImageViewStyle.ResourceUrl>
ControlStateChangeEventInternal?.Invoke(this, changeInfo);
- OnControlStateChanged(changeInfo);
-
if (controlStatePropagation)
{
foreach (View child in Children)
}
}
+ OnControlStateChanged(changeInfo);
+
ControlStateChangedEvent?.Invoke(this, changeInfo);
}
}