Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Maupin <ermaup@microsoft.com>2018-07-19 21:30:44 +0300
committerEric Maupin <ermaup@microsoft.com>2018-07-19 21:35:41 +0300
commit865c057febe458fe004ddc7820b6e50616b7009a (patch)
tree72874a259f1da483d51986fba42e8dcb41829039 /Xamarin.PropertyEditing.Windows.Standalone
parent2bd78ab81b5e6ff7b91e491d3851329ed504b637 (diff)
[Tests] Move brush properties down
Diffstat (limited to 'Xamarin.PropertyEditing.Windows.Standalone')
-rw-r--r--Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs6
-rw-r--r--Xamarin.PropertyEditing.Windows.Standalone/MockedSampleControlButton.cs55
2 files changed, 3 insertions, 58 deletions
diff --git a/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs b/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs
index 7713ff8..28f69b7 100644
--- a/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs
+++ b/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs
@@ -41,9 +41,9 @@ namespace Xamarin.PropertyEditing.Windows.Standalone
inspectedObject = mockedControl.MockedControl;
if (mockedControl is MockedSampleControlButton mockedButton) {
IObjectEditor editor = await this.panel.TargetPlatform.EditorProvider.GetObjectEditorAsync (inspectedObject);
- await mockedButton.SetBrushInitialValueAsync (editor, new CommonSolidBrush (20, 120, 220, 240, "sRGB"));
- await mockedButton.SetMaterialDesignBrushInitialValueAsync (editor, new CommonSolidBrush (0x65, 0x1F, 0xFF, 200));
- await mockedButton.SetReadOnlyBrushInitialValueAsync (editor, new CommonSolidBrush (240, 220, 15, 190));
+ await mockedButton.MockedControl.SetBrushInitialValueAsync (editor, new CommonSolidBrush (20, 120, 220, 240, "sRGB"));
+ await mockedButton.MockedControl.SetMaterialDesignBrushInitialValueAsync (editor, new CommonSolidBrush (0x65, 0x1F, 0xFF, 200));
+ await mockedButton.MockedControl.SetReadOnlyBrushInitialValueAsync (editor, new CommonSolidBrush (240, 220, 15, 190));
}
}
diff --git a/Xamarin.PropertyEditing.Windows.Standalone/MockedSampleControlButton.cs b/Xamarin.PropertyEditing.Windows.Standalone/MockedSampleControlButton.cs
index 5514b53..1620969 100644
--- a/Xamarin.PropertyEditing.Windows.Standalone/MockedSampleControlButton.cs
+++ b/Xamarin.PropertyEditing.Windows.Standalone/MockedSampleControlButton.cs
@@ -9,61 +9,6 @@ namespace Xamarin.PropertyEditing.Windows.Standalone
{
public MockedSampleControlButton () : base (new MockSampleControl ())
{
- // TODO: Move the declaration of this property to MockSampleControl once SolidBrush is supported on both platforms.
- this.brushPropertyInfo = new MockBrushPropertyInfo (
- name: "SolidBrush",
- category: "Windows Only",
- canWrite: true,
- colorSpaces: new[] { "RGB", "sRGB" });
- MockedControl.AddProperty<CommonBrush> (this.brushPropertyInfo);
-
- this.materialDesignBrushPropertyInfo = new MockBrushPropertyInfo (
- name: "MaterialDesignBrush",
- category: "Windows Only",
- canWrite: true);
- MockedControl.AddProperty<CommonBrush> (this.materialDesignBrushPropertyInfo);
-
- this.readOnlyBrushPropertyInfo = new MockBrushPropertyInfo (
- name: "ReadOnlySolidBrush",
- category: "Windows Only",
- canWrite: false);
- MockedControl.AddProperty<CommonBrush> (this.readOnlyBrushPropertyInfo);
-
- this.colorPropertyInfo = new MockPropertyInfo<CommonColor> (
- name: "ColorNoBrush",
- category: "Windows Only",
- canWrite: true,
- valueSources: ValueSources.Default | ValueSources.Local | ValueSources.Resource);
- MockedControl.AddProperty<CommonColor> (this.colorPropertyInfo);
}
-
- public async Task SetBrushInitialValueAsync (IObjectEditor editor, CommonBrush brush)
- {
- if (this.brushSet) return;
- await editor.SetValueAsync (this.brushPropertyInfo, new ValueInfo<CommonBrush> { Value = brush });
- this.brushSet = true;
- }
-
- public async Task SetMaterialDesignBrushInitialValueAsync (IObjectEditor editor, CommonBrush brush)
- {
- if (this.materialDesignBrushSet) return;
- await editor.SetValueAsync (this.materialDesignBrushPropertyInfo, new ValueInfo<CommonBrush> { Value = brush });
- this.materialDesignBrushSet = true;
- }
-
- public async Task SetReadOnlyBrushInitialValueAsync (IObjectEditor editor, CommonBrush brush)
- {
- if (this.readOnlyBrushSet) return;
- await editor.SetValueAsync (this.readOnlyBrushPropertyInfo, new ValueInfo<CommonBrush> { Value = brush });
- this.readOnlyBrushSet = true;
- }
-
- private readonly IPropertyInfo brushPropertyInfo;
- private readonly IPropertyInfo materialDesignBrushPropertyInfo;
- private readonly IPropertyInfo readOnlyBrushPropertyInfo;
- private readonly IPropertyInfo colorPropertyInfo;
- private bool brushSet = false;
- private bool materialDesignBrushSet = false;
- private bool readOnlyBrushSet = false;
}
}