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

PropertyMenuItemContainerStyleSelector.cs « Xamarin.PropertyEditing.Windows - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d8377c2b02112094affa763b9b2ba65589822a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Xamarin.PropertyEditing.Windows
{
	internal class PropertyMenuItemContainerStyleSelector
		: StyleSelector
	{
		public Style MenuItemStyle
		{
			get;
			set;
		}

		public Style SeparatorStyle
		{
			get;
			set;
		}

		public override Style SelectStyle (object item, DependencyObject container)
		{
			if (container is MenuItem)
				return MenuItemStyle;
			if (container is Separator)
				return SeparatorStyle ?? base.SelectStyle (item, container);

			return base.SelectStyle (item, container);
		}
	}
}