private void Burger_Click(object sender, RoutedEventArgs e) { hidden = !hidden; burger.Icon = new Image() { Source = ImageConverter.ByteToImageSource(hidden ? Icons.burgerIcon : Icons.arrowopen) }; hideableGrid.Visibility = hideableGrid.Visibility == Visibility.Visible ? Visibility.Hidden : Visibility.Visible; }
public NavigationInfo(Page content, byte[]?icon = default, NavigationOrder desired = NavigationOrder.AbsoluteStart) { if (desired == NavigationOrder.Null) { throw new NullReferenceException($"{nameof(desired)} was set to null location which is invalid."); } this.content = content; this.desired = desired; if (icon != null) { this.icon = ImageConverter.ByteToImageSource(icon); hasIcon = true; } }
private void SetupControls() { logger?.LogInfo($"Initializing Main Grid..."); InitializeMainGrid(); logger?.LogInfo($"Initializing Navigation Grid..."); InitializeNavigationGrid(); logger?.LogInfo($"Initializing Hideable Grid..."); InitializeHideableGrid(); pageViewer = new Frame() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, Content = orderedNavigations.ToList().First().Content }; //pageViewer.Background = Brushes.Red; burger = new IconButton() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, Icon = new Image() { Source = hidden ? ImageConverter.ByteToImageSource(Icons.burgerIcon) : ImageConverter.ByteToImageSource(Icons.arrowopen) } }; burger.Click += Burger_Click; back = new IconButton() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, Icon = new Image() { Source = ImageConverter.ByteToImageSource(Icons.arrowleft) } }; back.Click += Back_Click;; }
private void SetVisibility(bool collapsed) { switch (collapsed) { case false: buttonImage.Source = ImageConverter.ByteToImageSource(Icons.arrowopen); hideable.Visibility = Visibility.Visible; collapseButton.Visibility = Visibility.Visible; expandButton.Visibility = Visibility.Collapsed; break; case true: buttonImage.Source = ImageConverter.ByteToImageSource(Icons.arrowclosed); hideable.Visibility = Visibility.Collapsed; collapseButton.Visibility = Visibility.Collapsed; expandButton.Visibility = Visibility.Visible; break; } }