now hc styles can be referenced in window.resource
by the way, supported multiple themes at the same time, It may be related to #574
This commit is contained in:
1 parent
3be68c3010
commit
d997aee5f7
23 files changed
+161
-129
No files matched your search
+6
-6
@@ -14,9 +14,9 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.ComboBox
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("ComboBoxCapsule"),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("ComboBoxCapsule"),
|
||||
ItemsSource = Enum.GetValues(propertyItem.PropertyType),
|
||||
ItemTemplateSelector = ResourceHelper.GetResource<DataTemplateSelector>("HorizontalAlignmentPathTemplateSelector"),
|
||||
ItemTemplateSelector = ResourceHelper.GetResourceInternal<DataTemplateSelector>("HorizontalAlignmentPathTemplateSelector"),
|
||||
HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
@@ -48,16 +48,16 @@ namespace HandyControl.Controls
|
||||
switch (horizontalAlignment)
|
||||
{
|
||||
case HorizontalAlignment.Left:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignLeftGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignLeftGeometry"));
|
||||
break;
|
||||
case HorizontalAlignment.Center:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignHCenterGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignHCenterGeometry"));
|
||||
break;
|
||||
case HorizontalAlignment.Right:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignRightGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignRightGeometry"));
|
||||
break;
|
||||
case HorizontalAlignment.Stretch:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignHStretchGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignHStretchGeometry"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -15,6 +15,6 @@ namespace HandyControl.Controls
|
||||
|
||||
public override BindingMode GetBindingMode(PropertyItem propertyItem) => BindingMode.OneWay;
|
||||
|
||||
protected override IValueConverter GetConverter(PropertyItem propertyItem) => ResourceHelper.GetResource<IValueConverter>("Object2StringConverter");
|
||||
protected override IValueConverter GetConverter(PropertyItem propertyItem) => ResourceHelper.GetResourceInternal<IValueConverter>("Object2StringConverter");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public override FrameworkElement CreateElement(PropertyItem propertyItem) => new ToggleButton
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("ToggleButtonSwitch"),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("ToggleButtonSwitch"),
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
IsEnabled = !propertyItem.IsReadOnly
|
||||
};
|
||||
|
||||
+6
-6
@@ -14,9 +14,9 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.ComboBox
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("ComboBoxCapsule"),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("ComboBoxCapsule"),
|
||||
ItemsSource = Enum.GetValues(propertyItem.PropertyType),
|
||||
ItemTemplateSelector = ResourceHelper.GetResource<DataTemplateSelector>("VerticalAlignmentPathTemplateSelector"),
|
||||
ItemTemplateSelector = ResourceHelper.GetResourceInternal<DataTemplateSelector>("VerticalAlignmentPathTemplateSelector"),
|
||||
HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
@@ -48,16 +48,16 @@ namespace HandyControl.Controls
|
||||
switch (verticalAlignment)
|
||||
{
|
||||
case VerticalAlignment.Top:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignTopGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignTopGeometry"));
|
||||
break;
|
||||
case VerticalAlignment.Center:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignVCenterGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignVCenterGeometry"));
|
||||
break;
|
||||
case VerticalAlignment.Bottom:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignBottomGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignBottomGeometry"));
|
||||
break;
|
||||
case VerticalAlignment.Stretch:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignVStretchGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignVStretchGeometry"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user