Skip to content

Commit

Permalink
[NUI] Disable xaml in Scrollbar, Switch, etc in Components.
Browse files Browse the repository at this point in the history
  • Loading branch information
huayongxu authored and dongsug-song committed Feb 12, 2025
1 parent 7832d34 commit 2b6be80
Show file tree
Hide file tree
Showing 7 changed files with 1,172 additions and 311 deletions.
80 changes: 72 additions & 8 deletions src/Tizen.NUI.Components/Controls/ImageScrollBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ static ScrollBar()
propertyChanged: SetInternalCurrentValueProperty, defaultValueCreator: GetInternalCurrentValueProperty);
DurationProperty = BindableProperty.Create(nameof(Duration), typeof(uint), typeof(ScrollBar), default(uint),
propertyChanged: SetInternalDurationProperty, defaultValueCreator: GetInternalDurationProperty);
ThumbSizeProperty = BindableProperty.Create(nameof(ThumbSize), typeof(Size), typeof(ScrollBar), null,
propertyChanged: SetInternalThumbSizeProperty, defaultValueCreator: GetInternalThumbSizeProperty);
TrackImageURLProperty = BindableProperty.Create(nameof(TrackImageURL), typeof(string), typeof(ScrollBar), default(string),
propertyChanged: SetInternalTrackImageURLProperty, defaultValueCreator: GetInternalTrackImageURLProperty);
TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(ScrollBar), null,
propertyChanged: SetInternalTrackColorProperty, defaultValueCreator: GetInternalTrackColorProperty);
ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(ScrollBar), null,
propertyChanged: SetInternalThumbColorProperty, defaultValueCreator: GetInternalThumbColorProperty);
}
}

Expand Down Expand Up @@ -273,11 +281,25 @@ public Size ThumbSize
{
get
{
return GetValue(ThumbSizeProperty) as Size;
if (NUIApplication.IsUsingXaml)
{
return GetValue(ThumbSizeProperty) as Size;
}
else
{
return GetInternalThumbSizeProperty(this) as Size;
}
}
set
{
SetValue(ThumbSizeProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(ThumbSizeProperty, value);
}
else
{
SetInternalThumbSizeProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -307,11 +329,25 @@ public string TrackImageURL
{
get
{
return GetValue(TrackImageURLProperty) as string;
if (NUIApplication.IsUsingXaml)
{
return GetValue(TrackImageURLProperty) as string;
}
else
{
return GetInternalTrackImageURLProperty(this) as string;
}
}
set
{
SetValue(TrackImageURLProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(TrackImageURLProperty, value);
}
else
{
SetInternalTrackImageURLProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -341,11 +377,25 @@ public Color TrackColor
{
get
{
return GetValue(TrackColorProperty) as Color;
if (NUIApplication.IsUsingXaml)
{
return GetValue(TrackColorProperty) as Color;
}
else
{
return GetInternalTrackColorProperty(this) as Color;
}
}
set
{
SetValue(TrackColorProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(TrackColorProperty, value);
}
else
{
SetInternalTrackColorProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -374,11 +424,25 @@ public Color ThumbColor
{
get
{
return GetValue(ThumbColorProperty) as Color;
if (NUIApplication.IsUsingXaml)
{
return GetValue(ThumbColorProperty) as Color;
}
else
{
return GetInternalThumbColorProperty(this) as Color;
}
}
set
{
SetValue(ThumbColorProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(ThumbColorProperty, value);
}
else
{
SetInternalThumbColorProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down
36 changes: 20 additions & 16 deletions src/Tizen.NUI.Components/Controls/ScrollBarBindableProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,76 @@ public partial class ScrollBar
/// ThumbSizeProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty ThumbSizeProperty = BindableProperty.Create(nameof(ThumbSize), typeof(Size), typeof(ScrollBar), null, propertyChanged: (bindable, oldValue, newValue) =>
public static readonly BindableProperty ThumbSizeProperty = null;
internal static void SetInternalThumbSizeProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (ScrollBar)bindable;
if (newValue != null)
{
instance.InternalThumbSize = newValue as Size;
}
},
defaultValueCreator: (bindable) =>
}
internal static object GetInternalThumbSizeProperty(BindableObject bindable)
{
var instance = (ScrollBar)bindable;
return instance.InternalThumbSize;
});
}

/// <summary>
/// TrackImageURLProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty TrackImageURLProperty = BindableProperty.Create(nameof(TrackImageURL), typeof(string), typeof(ScrollBar), default(string), propertyChanged: (bindable, oldValue, newValue) =>
public static readonly BindableProperty TrackImageURLProperty = null;
internal static void SetInternalTrackImageURLProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (ScrollBar)bindable;
if (newValue != null)
{
instance.InternalTrackImageURL = newValue as string;
}
},
defaultValueCreator: (bindable) =>
}
internal static object GetInternalTrackImageURLProperty(BindableObject bindable)
{
var instance = (ScrollBar)bindable;
return instance.InternalTrackImageURL;
});
}

/// <summary>
/// TrackColorProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(ScrollBar), null, propertyChanged: (bindable, oldValue, newValue) =>
public static readonly BindableProperty TrackColorProperty = null;
internal static void SetInternalTrackColorProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (ScrollBar)bindable;
if (newValue != null)
{
instance.InternalTrackColor = newValue as Color;
}
},
defaultValueCreator: (bindable) =>
}
internal static object GetInternalTrackColorProperty(BindableObject bindable)
{
var instance = (ScrollBar)bindable;
return instance.InternalTrackColor;
});
}

/// <summary>
/// ThumbColorProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(ScrollBar), null, propertyChanged: (bindable, oldValue, newValue) =>
public static readonly BindableProperty ThumbColorProperty = null;
internal static void SetInternalThumbColorProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (ScrollBar)bindable;
if (newValue != null)
{
instance.InternalThumbColor = newValue as Color;
}
},
defaultValueCreator: (bindable) =>
}
internal static object GetInternalThumbColorProperty(BindableObject bindable)
{
var instance = (ScrollBar)bindable;
return instance.InternalThumbColor;
});
}
}
}
Loading

0 comments on commit 2b6be80

Please sign in to comment.