public FontPointStyleUserControl(PointStyle style) { InitializeComponent(); PointStyleViewModel pointStyleViewModel = new PointStyleViewModel(style); DataContext = pointStyleViewModel; string helpUri = GisEditor.LanguageManager.GetStringResource("FontPointStyleHelp"); if (!string.IsNullOrEmpty(helpUri)) { HelpUri = new Uri(helpUri); } }
public CustomSymbolPointStyleUserControl(PointStyle style) { InitializeComponent(); pointStyleViewModel = new PointStyleViewModel(style); DataContext = pointStyleViewModel; var heigth = pointStyleViewModel.ActualImage.GetHeight(); var width = pointStyleViewModel.ActualImage.GetWidth(); previewImage.Height = heigth > fixedSize ? fixedSize : heigth; previewImage.Width = width > fixedSize ? fixedSize : width; string helpUri = GisEditor.LanguageManager.GetStringResource("CustomPointStyleHelp"); if (!string.IsNullOrEmpty(helpUri)) { HelpUri = new Uri(helpUri); } }
public IconSource(PointStyleViewModel pointStyleViewModel) { viewModel = pointStyleViewModel; EnableEditSize = true; ConstrainProportions = true; iconCategories = IconHelper.GetIconCategories(); currentIcons = new ObservableCollection <IconEntity>(); SelectedCategory = IconCategories.First(); if (SelectedCategory != null) { if (viewModel.ActualImage != null) { var bitmapImage = new System.Windows.Media.Imaging.BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource = viewModel.ActualImage.GetImageStream(); bitmapImage.EndInit(); SelectedIcon = new IconEntity() { Icon = bitmapImage }; } if (selectedCategory.HasSubCategories) { SelectedSubCategory = SelectedCategory.SubCategories[0]; if (string.IsNullOrEmpty(viewModel.ImagePath) && SelectedIcon.Icon == null) { SelectedIcon = SelectedSubCategory.Icons[0]; } } else { if (string.IsNullOrEmpty(viewModel.ImagePath) && (SelectedIcon == null || SelectedIcon.Icon == null)) { SelectedIcon = SelectedCategory.Icons[0]; } } } }