if (value == null)
{
value = Activator.CreateInstance(type);
- if (value is BindableObject)
+ if (value is Element)
{
- ((BindableObject)value).IsCreateByXaml = true;
+ if (null != Application.Current)
+ {
+ Application.AddResourceChangedCallback(value, (value as Element).OnResourcesChanged);
+ }
+
+ if (value is BindableObject)
+ {
+ ((BindableObject)value).IsCreateByXaml = true;
+ }
}
}
}
{
//non-default ctor
object ret = Activator.CreateInstance(nodeType, arguments);
- if (ret is BindableObject)
+ if (ret is Element)
{
- ((BindableObject)ret).IsCreateByXaml = true;
+ if (null != Application.Current)
+ {
+ Application.AddResourceChangedCallback(ret, (ret as Element).OnResourcesChanged);
+ }
+
+ if (ret is BindableObject)
+ {
+ ((BindableObject)ret).IsCreateByXaml = true;
+ }
}
return ret;
}
else
{
value = Activator.CreateInstance(nodeType);
- if (value is BindableObject)
+ if (value is Element)
{
- ((BindableObject)value).IsCreateByXaml = true;
+ if (null != Application.Current)
+ {
+ Application.AddResourceChangedCallback(value, (value as Element).OnResourcesChanged);
+ }
+
+ if (value is BindableObject)
+ {
+ ((BindableObject)value).IsCreateByXaml = true;
+ }
}
}
/// <since_tizen> 3 </since_tizen>
public ImageView() : this(NDalicPINVOKE.ImageView_New__SWIG_0(), true)
{
- base.InitXamlResource();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
PageDown
}
- protected void InitXamlResource()
- {
- if (null != Application.Current)
- {
- Application.AddResourceChangedCallback(this, OnResourcesChanged);
- }
- }
-
/// <summary>
/// Creates a new instance of a view.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public View() : this(NDalicPINVOKE.View_New(), true)
{
- InitXamlResource();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true)
{
- InitXamlResource();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}