alicanerdogan/HamburgerMenu

Suggestion

DenSmoke opened this issue · 1 comments

I wanted to use your control, but I don't like idea to use pictures as icons, so it would be great if you add support of Segoe MDL2 Assets icons

@DenSmoke

There's no need to add support for anything, you can simply use DrawingImage and the like.

Example code using Mahapps Metro icons from the Resources package:

<HamburgerMenu:HamburgerMenuItem SelectionCommand="{Binding ElementName=this_}" Text="Dashboard">
                <HamburgerMenu:HamburgerMenuItem.Icon>
                    <DrawingImage>
                        <DrawingImage.Drawing>
                            <GeometryDrawing>
                                <GeometryDrawing.Geometry>
                                    <RectangleGeometry>
                                        <RectangleGeometry.Rect>
                                            <Rect Width="100" Height="100" />
                                        </RectangleGeometry.Rect>
                                    </RectangleGeometry>
                                </GeometryDrawing.Geometry>
                                <GeometryDrawing.Brush>
                                    <VisualBrush Stretch="Fill">
                                        <VisualBrush.Visual>
                                            <Rectangle Width="50"
                                                       Height="50"
                                                       Fill="White">
                                                <Rectangle.OpacityMask>
                                                    <VisualBrush Stretch="Fill" Visual="{StaticResource appbar_control_guide}" />
                                                </Rectangle.OpacityMask>
                                                <Rectangle.CacheMode>
                                                    <BitmapCache EnableClearType="true" RenderAtScale="4" />
                                                </Rectangle.CacheMode>
                                            </Rectangle>
                                        </VisualBrush.Visual>
                                    </VisualBrush>
                                </GeometryDrawing.Brush>
                            </GeometryDrawing>
                        </DrawingImage.Drawing>
                    </DrawingImage>
                </HamburgerMenu:HamburgerMenuItem.Icon>
            </HamburgerMenu:HamburgerMenuItem>

Renders like:

example