public void Load(TextBlock block) { try { if (block.AttributeExists(nameof(SplitterOrientation))) { SplitterOrientation = (Orientation)Enum.Parse(typeof(Orientation), block.GetAttribute(nameof(SplitterOrientation))); } } catch { } }
public void Load(TextBlock block) { try { if (block.AttributeExists(nameof(PanelMode))) { PanelMode = (ContentBrowser.PanelModeEnum)Enum.Parse(typeof(ContentBrowser.PanelModeEnum), block.GetAttribute(nameof(PanelMode))); } if (block.AttributeExists(nameof(ListMode))) { ListMode = (ContentBrowser.ListModeEnum)Enum.Parse(typeof(ContentBrowser.ListModeEnum), block.GetAttribute(nameof(ListMode))); } if (block.AttributeExists(nameof(TileImageSize))) { TileImageSize = int.Parse(block.GetAttribute(nameof(TileImageSize))); } if (block.AttributeExists(nameof(ListImageSize))) { ListImageSize = int.Parse(block.GetAttribute(nameof(ListImageSize))); } if (block.AttributeExists(nameof(ListColumnWidth))) { ListColumnWidth = int.Parse(block.GetAttribute(nameof(ListColumnWidth))); } if (block.AttributeExists(nameof(Breadcrumb))) { Breadcrumb = bool.Parse(block.GetAttribute(nameof(Breadcrumb))); } if (block.AttributeExists(nameof(SortFilesBy))) { SortFilesBy = (ContentBrowser.SortByItems)Enum.Parse(typeof(ContentBrowser.SortByItems), block.GetAttribute(nameof(SortFilesBy))); } if (block.AttributeExists(nameof(SortFilesByAscending))) { SortFilesByAscending = bool.Parse(block.GetAttribute(nameof(SortFilesByAscending))); } if (block.AttributeExists(nameof(FilteringModeButton))) { FilteringModeButton = bool.Parse(block.GetAttribute(nameof(FilteringModeButton))); } if (block.AttributeExists(nameof(MembersButton))) { MembersButton = bool.Parse(block.GetAttribute(nameof(MembersButton))); } if (block.AttributeExists(nameof(OpenButton))) { OpenButton = bool.Parse(block.GetAttribute(nameof(OpenButton))); } if (block.AttributeExists(nameof(EditorButton))) { EditorButton = bool.Parse(block.GetAttribute(nameof(EditorButton))); } if (block.AttributeExists(nameof(SettingsButton))) { SettingsButton = bool.Parse(block.GetAttribute(nameof(SettingsButton))); } if (block.AttributeExists(nameof(ButtonsForEditing))) { ButtonsForEditing = bool.Parse(block.GetAttribute(nameof(ButtonsForEditing))); } if (block.AttributeExists(nameof(SearchButton))) { SearchButton = bool.Parse(block.GetAttribute(nameof(SearchButton))); } //!!!! //if( block.AttributeExists( nameof( SearchBar ) ) ) // SearchBar = bool.Parse( block.GetAttribute( nameof( SearchBar ) ) ); if (block.AttributeExists(nameof(SplitterPosition))) { SplitterPosition = double.Parse(block.GetAttribute(nameof(SplitterPosition))); } } catch { } }