mahapps.metro

How to use icon in mahapps hamburger menu XAML

大憨熊 提交于 2019-12-11 14:26:10
问题 How do I use Entypo icon in mahapps hamburger menu? I've tried many ways but nothing works. Below is my xaml code: <controls:HamburgerMenu.ItemsSource> <controls:HamburgerMenuItemCollection> <controls:HamburgerMenuIconItem Icon="{iconPacks:PackIconEntypo Kind=Users}" Label="Accounts"> <controls:HamburgerMenuIconItem.Tag> <views:AccountsView/> </controls:HamburgerMenuIconItem.Tag> </controls:HamburgerMenuIconItem> </controls:HamburgerMenuItemCollection> </controls:HamburgerMenu.ItemsSource>

Mahapp ShowMessageAsync MvvM

给你一囗甜甜゛ 提交于 2019-12-11 11:57:03
问题 I created the simplest WPF project with a MVVM pattern. How can I call ShowMessageAsync from my viewModel? if (DisciplineText!="") { Disciplines.Add(new Discipline(){ChairID = SelectedChair.ChairID,SemesterID = SelectedSemester.SemesterID,Discipline1 = DisciplineText}); Context.SaveChanges(); } else { // ShowMessageAsync???????? } 回答1: MetroWindow metroWindow = Application.Current.MainWindow as MetroWindow; metroWindow.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented; // set

MaterialDesignXamlToolkit wpf dialoghost buttons are disabled when opened

情到浓时终转凉″ 提交于 2019-12-11 09:49:36
问题 I am using the MaterialDesignThemes nuget package along with the Mahapps.Metro package I have this DialogHost <material:DialogHost Name="PopupAddCustom" HorizontalAlignment="Center" VerticalAlignment="Center" IsOpen="False" > <material:DialogHost.DialogContent> <StackPanel Margin="16" Orientation="Vertical"> <Label Content="Add custom date" FontSize="16" /> <DatePicker /> <StackPanel Orientation="Horizontal"> <Button Content="ACCEPT" Style="{DynamicResource MaterialDesignFlatButton}"

WPF Net Framework 3.5 Window Metro Style

感情迁移 提交于 2019-12-11 06:36:44
问题 I want to make Window with Metro style. I found the 3 following libraries: http://elysium.asvishnyakov.com/en/ https://github.com/MahApps/MahApps.Metro http://mui.codeplex.com/ All are for Net Framework 4+. Is there anything for 3.5? I also tried to make it on my own (Didnt finish - still need to design it and add Resize [which I dont know how]) but I dont really like how it's made...: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

Assign Mahapps.Metro:IconPacks to button in code behind

匆匆过客 提交于 2019-12-11 04:57:00
问题 I am trying to assign an icon from any Mahapps.Metro.IconPacks to an rectangle respectively to a button with text. How do I do this if I want to use the new IconPacks? Effectively I need to convert an Mahapps.Metro.IconPacks.PackIconModernKind to VisualBrush or canvas or actually anything I can use to place it in a button. Any help is appreciated! Thanks 回答1: You can place any IconPack Control directly to the content of the Button or to a container like a Grid . The Xaml way <Button Content=

Using MahApps Icons with ContextMenu

耗尽温柔 提交于 2019-12-10 16:48:25
问题 I am writing a WPF application using the MahApps Metro UI toolkit. http://mahapps.com/guides/quick-start.html From the guide on their website, I have basically finished my application and it looks slick. The only issue I have is I have not been able to find out how to use the icon packs they provide as contextmenu icons. Here's an visual example of what I'm trying to do. While I was able to get the original "Windows" menu item to display it's icon, I am unable to do the same for the

How to create MahApps.Metro accent resource from specific color?

烂漫一生 提交于 2019-12-10 11:57:57
问题 I've noticed this on the MahApps site (bottom of the page): "It is also possible to create an accent resource dictionary dynamically by using a specific color.", but I found more nowhere. Is there really a built-in method (or anything else) for this? I've only found ThemeManager.AddAccent(string name, Uri resourceAddress) , and creating a new accent (currently) possible with new Accent(string name, Uri resourceAddress) , so a name and a resource uri is everyhow needed... Any ideas? 回答1: Here

KeyUp event is doubling using “mahapps.metro”

扶醉桌前 提交于 2019-12-10 10:46:02
问题 Complete project: https://uploadfiles.io/wz8ji Follow code: Code C#: public partial class MainWindow : MetroWindow { public MainWindow() { InitializeComponent(); } private void Textbox_KeyUp(object sender, KeyEventArgs e) { if (textbox.Text != string.Empty) { this.ShowMessageAsync("This is the title", "Some message"); } } } Code xaml: <Controls:MetroWindow x:Class="Wpf.MainWindow" xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml

Customizing Mahapps.MetroWindow Close Button

别来无恙 提交于 2019-12-09 12:17:19
问题 I'm using Mahapps.MetroWindow ( http://mahapps.com/ ) to style my applications appearance and right now I'm looking for the right way to customize the appearance of the X / Close button. By default MetroWindow applies custom styling to all three command buttons. I would like to either match Windows in always having the Close button be red or on mouse over become red. What I found so far was, that I can set the WindowCloseButtonStyle attribute to a custom style. I did so like this: <controls

MahApps - How to disable automatic uppercase of default button

你说的曾经没有我的故事 提交于 2019-12-09 09:17:10
问题 I have started to introduce MahApps .Metro (really awesome) in my WPF application and my favorite button is the default. The problem is that it puts all my text in uppercase and I don't want it. 回答1: You can override the default value by setting the property for all buttons in Window.Resources <controls:MetroWindow ... xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft