internal static void SetUwpControlValue(this WindowsXamlHostBase wrapper, object value, [CallerMemberName] string propName = null) { Windows.UI.Xaml.UIElement control = wrapper.GetUwpInternalObject() as Windows.UI.Xaml.UIElement; if (control != null) { control.GetType().GetRuntimeProperty(propName).SetValue(control, value); } else { Dictionary <string, object> properties = GetDesignerProperties(wrapper); properties[propName] = value; } }
internal static object GetUwpControlValue(this WindowsXamlHostBase wrapper, object defaultValue = null, [CallerMemberName] string propName = null) { Windows.UI.Xaml.UIElement control = wrapper.GetUwpInternalObject() as Windows.UI.Xaml.UIElement; if (control != null) { return(control.GetType().GetRuntimeProperty(propName).GetValue(control)); } else { Dictionary <string, object> properties = GetDesignerProperties(wrapper); if (properties.ContainsKey(propName)) { return(properties[propName]); } return(defaultValue != null ? defaultValue : GetDefaultValueForProperty(wrapper, propName)); } }