mahapps.metro

How To Create A Custom Accent In MahApps.Metro?

℡╲_俬逩灬. 提交于 2019-12-30 11:42:31
问题 I'm trying to override the default style of the flyout. I tried to move all my styles in an own ResourceDictionary and used <Style x:Key="DefaultFlyout" TargetType="controls:Flyout" BasedOn="{StaticResource {x:Type controls:Flyout}}"> , but it always ignores what I enter in BasedOn . Directly using {StaticResource Flyout} doesn't work because it's an unknown identifier, and DynamicResource isn't supported for BasedOn . My resource dictionary Controls.xaml : <ResourceDictionary xmlns="http:/

How To Create A Custom Accent In MahApps.Metro?

谁都会走 提交于 2019-12-30 11:42:15
问题 I'm trying to override the default style of the flyout. I tried to move all my styles in an own ResourceDictionary and used <Style x:Key="DefaultFlyout" TargetType="controls:Flyout" BasedOn="{StaticResource {x:Type controls:Flyout}}"> , but it always ignores what I enter in BasedOn . Directly using {StaticResource Flyout} doesn't work because it's an unknown identifier, and DynamicResource isn't supported for BasedOn . My resource dictionary Controls.xaml : <ResourceDictionary xmlns="http:/

How to draw 1216 canvas elements without hanging application in WPF

核能气质少年 提交于 2019-12-30 06:49:45
问题 I am developing an app I want to add some cool icons. Because I am using the beautiful MahApps library, I want to have a visual on the icons in MahApps.Metro/MahApps.Metro.Resources/Icons.xaml, so I did some string manipulations to grab the x:Key part of each <Canvas x:Key="appbar_3d_3ds" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0"> line. In short, all the string manipulations I did ended up with 1216 copies of the following: <controls:Tile Title="appbar_zune" Count="1215"

WPF binding mahapps metro icons in template

a 夏天 提交于 2019-12-25 08:59:17
问题 I would like to transform this button code into a template version and put it in a style xaml file: <Button Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="20" Foreground="White" Opacity="1"> <StackPanel Orientation="Horizontal"> <Rectangle Width="24" Height="24" Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"> <Rectangle.OpacityMask> <VisualBrush Stretch="Fill" Visual="{iconPacks

WPF DataGrid StyleSelector for Rows

☆樱花仙子☆ 提交于 2019-12-25 06:59:22
问题 I'm trying to use an ItemContainerStyleSelector to display different row styles in a datagrid, based on the type of the object defining the row (ItemsSource is a collection of IGridItem s, there are GridItem and GridSeparator which should get different styles). my problem was, that the SelectStyle of my StyleSelector was never called. Now I found out (here) the problem could be an inherited style (MahApps Metro library redefines the default styles of all standard controls), which probably

WPF: How to remove menu popup border

半腔热情 提交于 2019-12-25 04:34:35
问题 I want to remove menu's popup border. Not the menu items's border as explained in this post. This is a pic of my menu popup and I want to remove the white border the popup has. I am using mahapps library for my main windows with basedark theme. Also please be patient with me, as I am new to WPF and XAML. Here are all the things I have tried- Overwrote the border thickness and border brush of all the "menu items" with my custom style. This did not help as the border which I am interested is

How To Add An Icon From File To MahApps.Metro WPF Window?

孤者浪人 提交于 2019-12-24 16:36:51
问题 MahApps.Metro's documentation has an icon at the top left of their tool bar. It's called a Window Icon, and I've been having trouble getting one working. I have a file called image.ico and I've added it as a resource in VisualStudio 2013, by going to Project -> myproject Properties... -> Resources Tab -> Add Existing File... -> Selecting image The file is now listed as a resource named 'image', with its persistence set to 'Linked at compile time'. I've tried two different tactics to get this

FullscreenBehaviour for Mahapps

余生长醉 提交于 2019-12-24 13:15:39
问题 How to add a dynamic switching ability from fullscreen to windowed mode and vice versa to Mahapps MetroWindow? Starting with Normal Window and after switching to fullscreen the top right window Buttons (Minimize/Maximize/Close) are still visible (but they shouldn't be visible as well as the title bar). The reserved space for the title bar seems to be still there. The other way round initially from fullscreen state (no buttons, except the Hello button in the middle and no title bar => as

How to manually bind static Items to SplitButton (mahapps) via XAML

江枫思渺然 提交于 2019-12-24 00:34:43
问题 How do i manually add for example 2 items (buttons) from which the first is preselected via xaml? Like: <controls:SplitButton SelectedIndex="0"> <controls:SplitButton.Items> <Button Content="Button 1"/> <Button Content="Button 2"/> </controls:SplitButton.Items> </controls:SplitButton> Documentation tells me to use ItemsSource Binding but there is no example of the code behind. 回答1: This is the XAML: <controls:SplitButton x:Name="splitButton" SelectedIndex="1" HorizontalAlignment="Left"

MahApps.Metro icon not showing

风格不统一 提交于 2019-12-23 10:28:18
问题 I am trying to add a "refresh" button in the window title bar, using MahApps.Metro 0.13.1.0. My App.xaml is this : <Application x:Class="VersionSwitcher.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Views/MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"> <Application.Resources>