MahApps.Metro | allows developers to cobble
kandi X-RAY | MahApps.Metro Summary
kandi X-RAY | MahApps.Metro Summary
A toolkit for creating modern WPF applications. Lots of goodness out-of-the box. Supporting .NET Framework 4.6.2 and greater, .NET Core 3.1, .NET 5 and .NET 6 (on Windows).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MahApps.Metro
MahApps.Metro Key Features
MahApps.Metro Examples and Code Snippets
Community Discussions
Trending Discussions on MahApps.Metro
QUESTION
I'm working on some application to get more experience with WPF applications.
I manage the application frames with TabItem control of MahApps.Metro library like this:
MainWindow.xaml
...ANSWER
Answered 2022-Jan-10 at 10:09First of all, you don't need to Bind the Datacontext, since it inherits from it's visual parent (unless you want it otherwise). DataContext set to MainWindow -> TabControl -> Tabitem -> UserControl
As Clemens commented, you will need a common ViewModel as part of the MVVM-pattern, whose Properties are bound to the Visuals inside your UserControl. Updating the values happens in the ViewModel (speaking of a very basic implementation), when Property changes (see: InotifyPropertyChanged)
I made a very basic example for this, see on GitHub (It's .net Framework 4.7.2, so the project structure might differ to yours)
QUESTION
General:
- WPF application
- Using mahapps.metro
- Using mahapps progress dialog
What do I want to achieve
- Open mahapps progress dialog
- During progress dialog doing some stuff
- One of the doing stuff is to open a webbrowser element for user login --> after login I get the cookies back
- Do some stuff only after login procedure (task)
Current Problem
The problem is, that I have to create a task for the mahapps progress dialog like the following ...
...ANSWER
Answered 2021-Aug-16 at 18:43You will need to make use of either the Dispatcher or the DispatcherSynchronizationContext to "marshal" the call from within your Task to the main UI thread. Here's how you could use the DispatcherSynchronizationContext:
QUESTION
I have created the following installation routine with the WIX toolset. The installation takes place as desired, but only the TopShelf service is uninstalled. However, the program folder and the files contained in it remain. What is missing so that the program folder + files are also removed during the uninstallation?
...ANSWER
Answered 2021-Aug-09 at 11:57Clean Testing: You should try the package on a clean virtual to see if you have a "dirty state" on your main box - from prior experiments. It is not uncommon to find several versions of your package in Add / Remove - potentially with different names. This can happen in several ways, but usually it is because of misconfigured major upgrade settings for one or more test versions. Files are not uninstalled before all "clones" are uninstalled. There can also be other reasons for files remaining after uninstall.
List Installed Packages: You can run this script to get a list of all MSI packages installed on your machine: https://github.com/glytzhkof/all/blob/master/MsiHtmlReport-Mini-V4.vbs
Service Installation: You should not use custom actions to install services when using Windows Installer. Here is an old answer to explain why and a sample of how services are supposed to be installed:
- How to install services with WiX / MSI
- https://github.com/Robs79/How-to-create-a-Windows-Service-MSI-Installer-Using-WiX
Essentially you use the ServiceInstall
and ServiceControl
constructs inside the MSI.
QUESTION
Question: Can we change the height of the title bar displayed in MahApps.Metro?
Details: For instance, in the following XAML example from the MahApps team, I want to display the content Deploy CupCake
- of the TextBlock
- below the image of the CupCake. So I removed the Orientation="Horizontal"
from the StackPanel
in the following XAML. As shown in the snapshot below, the content Deploy CupCake
is now showing below the image of CupCake - but it is hiding almost all of it. How can we make this content show all of it below the CupCake image?
Snapshot of the Toolbar with MahApps.Metro: Only about 10% of the content is showing below the image.
...ANSWER
Answered 2021-Apr-22 at 06:54First of all, it is better to use a to use a panel that distributes the available space among its content, like a Grid
, to prevent cutting off content as with the StackPanel
. Here, the data template defines a Grid
with two rows, where the TextBlock
scales to its desired size and the icon takes up the remaining available space. Also note the HorizontalAlignment
of the icon, it is centered.
QUESTION
Application I work on is WPF/.Net Core 3.1. It uses ListView
with custom View
(that show items in WrapPanel
). Everything works fine until I add reference to MahApps.Metro and include necessary MahApps.Metro resources in App
. Afterwards ListView
functionality breaks up, items are not longer shown as in WrapPanel
, just as ordinary list...
Also I get following errors in debug output:
ANSWER
Answered 2021-Feb-17 at 11:33The binding errors while debugging originate from the MahApps default style for ListView
. As you can see in the MahApps.Styles.ListView
style, the control template contains a ScrollViewer
that references a style called MahApps.Styles.ScrollViewer.GridView
. This style is specific to a GridView
and contains bindings to all the properties that are not found at runtime in the GridViewHeaderRowPresenter
.
In other words, the default style for ListView
in MahApps expects a GridView
. In order to fix this, you will have to create a custom MahApps.Styles.ListView
style to support your TileView
.
The WrapPanel
is applied in your application, but not when using MahApps. It seems that actually a VirtualizingStackPanel
is applied. The MahApps default style for ListBox
contains this Trigger
:
QUESTION
Question: 1
) Which of the following icon packs contain text editing icons (copy/paste, numbering lists, etc.) 2
) and, which ones contain symbols such as summation, square roots etc.)? Because of the size concern, I would like to install only the ones I need from here.
ANSWER
Answered 2021-Jan-12 at 17:01You can browse the icons using their icon pack browser found here https://github.com/MahApps/MahApps.Metro.IconPacks/releases/download/4.8.0/IconPacks.Browser.Release-v4.8.0-rc0006.zip
Since file size is a concern you can use that browser to copy the path geometry so you don't have to install an entire pack just the icons you want and just reference them in your App.xaml file in a PathGeometry item to use them
QUESTION
I've been running into a strange issue with a listbox within a UserControl with WPF and MVVM. The listbox has its items bound via a ViewModel and an ObservableCollection
, the style property IsSelected
is bound to a property Selected
inside the individual items.
ANSWER
Answered 2021-Jan-11 at 10:57I suspect this is due to virtualization. The UI items don't exist until they are scrolled into view.
Try turning off virtualization on your list control:
QUESTION
I am using MahApps.Metro in my WPF app and trying to change the Maximize/RestoreDown
icons of MetrowWindow to the following new FullScreen/BackToWindow
icons:
Question: How can we replace the default Maximize/RestoreDown
icons of MetrowWindow
?
Remarks: As suggested here, I tried the following code but it's still showing the old style - as shown below. I'm probably missing something here and not doing it right. New icons are not an issue. I just need to know how we can replace the old ones with the new ones.
...ANSWER
Answered 2021-Jan-11 at 10:55In order to customize the window buttons, you have to create a custom control template for the type WindowButtonCommands
. You can copy one of the default control templates below from GitHub.
I took the Win10
control template and and adapted two things in the PART_Max
button:
- Change the
Data
ofPART_MaxPath
Path
to an appropriate path that represents the icon or replace it with aTexBlock
that uses the Segoe MDL2 Assets font and displays the gylph. - Change the
DataTrigger
forMaximized
to set the appropriate icon the same way.
In the example below, I used the TextBlock
approach, because I do not have path data for the icons. Please be aware, that the Path
variant would always work, while the TextBlock
variant requires the font to be available on your system.
QUESTION
I am using MahApps.Metro in my WPF
app. The default behavior of the title bar of its MetroWindow is that any icon inside it has low opacity (dimmed) display unless you mouseover the icon. Even if you don't mouseover the icon, I would like to look it the same as when you mouseover it. How can we achieve this?
With mouseover on CupCakes icon [I would like it to look the same even without mouseover]:
Without mouseover:
MetroWindow.xaml:
...ANSWER
Answered 2021-Jan-05 at 11:00To override the styles of the inner controls of the WindowCommands
you must create your own style for it:
QUESTION
As shown below, by default, the MetroWindow of MahApps.Metro shows the title of the Window in uppercase, background of the title as blue and the forecolor as white.
Question: How can we change the above properties using MahApps.Metro
?
ANSWER
Answered 2021-Jan-05 at 10:41Here are the properties of the MetroWindow
which changes the title bar in MahApps v2.4.x
TitleCharacterCasing
: Changes the character casing with the CharacterCasing enumeration valuesTitleForeground
: Gets or sets the brush used for the titlebar's foregroundWindowTitleBrush
: Gets or sets the brush used for the Window's title barNonActiveWindowTitleBrush
: Gets or sets the brush used for the Window's non-active title bar
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MahApps.Metro
Quick Start
Icons (MahApps.Metro.IconPacks)
Contributing to MahApps.Metro
Building the MahApps.Metro solution
Releases and Release Notes
Visual Studio Templates
Wiki
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page