public AvalonWorkbenchWindow(AvalonDockLayout dockLayout) { if (dockLayout == null) { throw new ArgumentNullException("dockLayout"); } CustomFocusManager.SetRememberFocusedChild(this, true); this.IsFloatingAllowed = true; this.dockLayout = dockLayout; viewContents = new ViewContentCollection(this); SD.ResourceService.LanguageChanged += OnTabPageTextChanged; }
public AvalonPadContent(AvalonDockLayout layout, PadDescriptor descriptor) { this.descriptor = descriptor; this.layout = layout; CustomFocusManager.SetRememberFocusedChild(this, true); this.Name = descriptor.Class.Replace('.', '_'); this.SetValueToExtension(TitleProperty, new StringParseExtension(descriptor.Title)); placeholder = new TextBlock { Text = this.Title }; this.Content = placeholder; this.Icon = PresentationResourceService.GetBitmapSource(descriptor.Icon); placeholder.IsVisibleChanged += AvalonPadContent_IsVisibleChanged; }
public AvalonPadContent(AvalonDockLayout layout, PadDescriptor descriptor) { this.descriptor = descriptor; this.layout = layout; CustomFocusManager.SetRememberFocusedChild(this, true); this.Name = descriptor.Class.Replace('.', '_'); this.SetValueToExtension(TitleProperty, new StringParseExtension(descriptor.Title)); placeholder = new TextBlock { Text = this.Title }; this.Content = placeholder; if (String.IsNullOrEmpty(descriptor.PackIconKey)) { if (!String.IsNullOrEmpty(descriptor.Icon)) { this.Icon = PresentationResourceService.GetBitmapSource(descriptor.Icon); HasIcon = true; } } else { if (descriptor.PackIconKey.Contains(";")) { string[] packIconValues = descriptor.PackIconKey.Split(';'); string packIconType = packIconValues[0]; string packIconKind = packIconValues[1]; switch (packIconType) { case "PackIconMaterial": PackIconKind = (Enum)Enum.Parse(typeof(PackIconMaterialKind), packIconKind); break; case "PackIconMaterialLight": PackIconKind = (Enum)Enum.Parse(typeof(PackIconMaterialLightKind), packIconKind); break; case "PackIconModern": PackIconKind = (Enum)Enum.Parse(typeof(PackIconModernKind), packIconKind); break; case "PackIconOcticons": PackIconKind = (Enum)Enum.Parse(typeof(PackIconOcticonsKind), packIconKind); break; case "PackIconSimpleIcons": PackIconKind = (Enum)Enum.Parse(typeof(PackIconSimpleIconsKind), packIconKind); break; case "PackIconEntypo": PackIconKind = (Enum)Enum.Parse(typeof(PackIconEntypoKind), packIconKind); break; case "PackIconFontAwesome": PackIconKind = (Enum)Enum.Parse(typeof(PackIconFontAwesomeKind), packIconKind); break; } HasPackIcon = true; } } placeholder.IsVisibleChanged += AvalonPadContent_IsVisibleChanged; }