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:
authorLarry Ewing <lewing@microsoft.com>2018-07-18 23:17:39 +0300
committerLarry Ewing <lewing@microsoft.com>2018-07-18 23:17:39 +0300
commit559c6a98d81fabf584505b0b7eea936c52839a85 (patch)
tree05ce650f0417b4e2c87e986e9c3079dcbec071d1 /Xamarin.PropertyEditing.Mac/Controls
parent7ce5161445277fafb0188dc31c2f035ccbd43d6d (diff)
[mac] make MaterialView a NotifingView so that we pick up Normal/Accent correctly
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs19
1 files changed, 9 insertions, 10 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs
index e6c67d5..b1d9743 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs
@@ -1,4 +1,5 @@
using System;
+using System.ComponentModel;
using System.Linq;
using AppKit;
using CoreAnimation;
@@ -8,7 +9,7 @@ using Xamarin.PropertyEditing.ViewModels;
namespace Xamarin.PropertyEditing.Mac
{
- internal class MaterialView : NSView
+ internal class MaterialView : NotifyingView<BrushPropertyViewModel>
{
public override bool IsFlipped => true;
@@ -22,16 +23,14 @@ namespace Xamarin.PropertyEditing.Mac
WantsLayer = true;
}
- private BrushPropertyViewModel viewModel;
- public BrushPropertyViewModel ViewModel {
- get => viewModel;
- set {
- if (viewModel == value)
- return;
+ public override void OnViewModelChanged (BrushPropertyViewModel oldModel)
+ {
+ NeedsLayout = true;
+ }
- viewModel = value;
- NeedsLayout = true;
- }
+ public override void OnPropertyChanged (object sender, PropertyChangedEventArgs e)
+ {
+ NeedsLayout = true;
}
public MaterialDesignColorViewModel MaterialDesign {