コード例 #1
0
		public ApplicationLookViewModel()
		{
			TopAreaColorCommand = new DelegateCommand(TopAreaColorAction);
			BottomAreaColorCommand = new DelegateCommand(BottomAreaColorAction);

			ZoneHeightCollection = new ObservableCollection<int>();
			InitZoneHeightsArray();
		    CurrentSize = SettingsService.SelectionAreaHeight;
			BottomColor = new ColorContainer
			{

				Color = SettingsService.BottomBackgroundColor
			};
			TopColor = new ColorContainer
			{
				Color = SettingsService.TopBackgroundColor
			};
		}
コード例 #2
0
	    public IndiagramPropertyViewModel()
	    {
	        ReinforcerColorCommand = new DelegateCommand(ReInforcerColorAction);
            TextColorCommand = new DelegateCommand(TextColorAction);

	        ReinforcerColor = new ColorContainer
	        {
	            Color = SettingsService.ReinforcerColor
            }; 
            TextColor = new ColorContainer
            {
                Color = SettingsService.TextColor
            };
		    ReinforcerEnabled = SettingsService.IsReinforcerEnabled;
		    BackAfterSelection = SettingsService.IsBackHomeAfterSelectionEnabled;
		    MultipleIndiagramSelection = SettingsService.IsMultipleIndiagramSelectionEnabled;

	        IndiagramSizes = new ObservableCollection<int>();
		    int maxIndiagramSize = (int)(LazyResolver<IScreenService>.Service.Height*0.4);

	        foreach (int size in new[] {32, 48, 64, 80, 128, 160, 200, 256, 280, 300, 350, 400, 450, 500, 550, 600}.Where(x => x <= maxIndiagramSize))
	        {
	            IndiagramSizes.Add(size);
	        }
	        IndiagramSize = SettingsService.IndiagramDisplaySize;

	        FontSizes = new ObservableCollection<int>();
			
	        foreach (int size in Enumerable.Range(8, 50).Where(x => x % 2 == 0))
	        {
	            FontSizes.Add(size);
	        }
	        FontSize = SettingsService.FontSize;

	        FontNames = new ObservableCollection<string>();
	        foreach (string font in FontService.FontList.Keys)
	        {
	            FontNames.Add(font);
	        }
		    if (FontService.FontList.ContainsValue(SettingsService.FontName))
		    {
			    FontName = FontService.FontList.First(
				    x => string.Equals(x.Value, SettingsService.FontName, StringComparison.OrdinalIgnoreCase)).Key;
		    }
		    else
		    {
			    FontName = FontService.FontList.First().Key;
		    }
	    }