mahapps / mahapps.metro Goto Github PK
View Code? Open in Web Editor NEWA framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
Home Page: https://mahapps.com
License: MIT License
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
Home Page: https://mahapps.com
License: MIT License
We occasionally get PRs where people have run R# over the codebase to suit their style - which distracts from the code changes and leads to endless debate around what settings are right.
See this topic for why we will ask for a PR to be redone.
I'd like to use this as an opportunity to talk about what R# settings you use and which ones should be applied to MahApps.Metro. No pull requests at this point - I'd rather do this carefully and accurately and include a R# settings file in source control so that people know what the rules are.
EDIT: I'll clarify my intent here - cleaning up a codebase should not be done in one fell swoop - it should be done carefully and methodically.
One of my favourite goals in this regard is the Boy Scouts rule: "Always leave the campground cleaner than you found it."
The workflow should be this:
Always keep them separate. Always.
Starting things off with a couple of my choices:
var - use wherever possible. Your variable names should be meaningful so I don't need to read the type alongside it. Also helps with code alignment.
Underscores for field names - no. An icky reminder of times past.
Fire away.
Using a Controls:MetroWindow.WindowCommands/Controls:WindowCommands/Button
with a Click
handler in the code-behind works fine, but if I use Caliburn.Micro it doesn't automatically get bound to the ViewModel's action.
Instead I have to explicitly set up the action:
<Controls:MetroWindow.WindowCommands>
<Controls:WindowCommands>
<Button x:Name="ViewLogs" Content="VIEW LOGS">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="ViewLogs"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Controls:WindowCommands>
</Controls:MetroWindow.WindowCommands>
I'm not sure if this is a MahApps.Metro bug or a Caliburn.Micro bug, I don't know enough about how either works to say, but if I just drop the above and put a <Button x:Name="ViewLogs" Content="VIEW LOGS'/>
within the <Controls:MetroContentControl>
, everything works fine.
I'm using MahApps.Metro 0.7 and Caliburn.Micro 1.3.1.0, both from NuGet.
This is expected behaviour and inline with other apps. However, otherapps tend to have a solid, 1px grey border around them at all times.
We have the code in BorderlessWindowBehaviour to do that, perhaps this should be adjusted for OS > 6.1
Rather than the minimize, maximize and close buttons icon in the title bar I get 0, 1 and r respectively.
This is with 0.5.0 - any ideas?
Left and Right clicking the icon should bring the contextmenu for resizing,moving, etc. and double clicking it should close the window.
When I set WindowState to Maximized there is "Maximise" button between "Close" and "Minimise" instead of "Restore" button.
The AppBarButton class will not load its image unless the image is already loaded by some other object. To reproduce this in the sample application simply comment out the button that uses the appbar_barcode image thus:
<!--
<Button Style="{DynamicResource MetroCircleButtonStyle}"
Height="55"
Width="55"
VerticalAlignment="Top">
<Rectangle Width="20"
Height="20">
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{StaticResource appbar_barcode}" />
</Rectangle.Fill>
</Rectangle>
</Button>
-->
The 2 AppBarButtons that also use this image will now be empty.....
Apologies, but I am still a bit new to xaml so I am not in a position to suggest a solution at the present time.
When using the Tile, there does not seem to be a built-in method of placing child content of a Tile vertically aligned to the top of the Tile. I've tried various settings of the VerticalContentAlignment and VerticalAlignment, but the inner content always stays at just above the Title.
The only way I've found to have the child content align at the top is to explicitly define it's height:
<mah:Tile>
<Grid Height="140" Width="140">
<TextBlock Text="My Text" />
</Grid>
</mah:Tile>
Would it be possible to update the Tile so the inner content can be set vertically top, middle or bottom without having to define the inner content's height?
Using the "Count" property to set the inner text has the same issue, re: can not set to vertically top aligned.
I need a way to hide the Resize Grip, its not needed in all situations.
Hi,
I've got some problems with MetroWindow and position of webbrowser in it
It happens on every window open. If I resize window - everything becomes normal
you can just move mouse on maximize button.
markup is very simple
<metro:MetroWindow
<Grid
<Webbroser in grid cell
if I remove MetroWindow and place simple Window - everything is ok from the start.
I use
Can you help with this issue? is there any fix or something?
Not a big deal, but I mention it here.
The tooltips of the minimize/maximize/close buttons aren't localized to the current culture of the OS.
I did a bit research, but I found no way to inherit the tooltips of the window commands.
The MetroWindow should be resizable on all four window borders, just like a normal window.
ShowTitlebar=false still "occupies" the default 30px at the top. Setting that to 0 hides the WindowsCommands
https://github.com/MahApps/MahApps.Metro/blob/master/MahApps.Metro/Themes/Generic.xaml#L509
The ProgressIndicator component does not have a property to stop showing the effect.
I'm working on a small project for controlling my monitor brightness, along with a few other things. For me, its natural to use MA.M for the UX, and thats why I posted the question about animations/transitions, as I had a need in that app for them.
Now, its becoming a much larger app than originally intended, but it shows some clear uses of MA.M in a MVVM (Caliburn Micro) situation, and how to create (what I think is) a good UX with the library.
Is anybody interested in that style of sample app? That is, more than a "Hello, World", but an actual app?
If so, are there certain elements (controls, interaction with other libraries, etc) that people want to see in such a demo app?
Using v0.7.1.0, the TextBlock does not inherit the dark color scheme. This is reproducible by running the demo project and switching to any of the dark themes; on the 2nd tab (more controls here!), there are TextBlocks used as headers above the ComboBoxes which will exhibit this issue.
Hi,
in the current version availible on nuget 0.7.2.0 Combobox IsEditable=True doesn't seem to work anymore. Had to switch back to version 0.7.1.0 found in your sample code.
Applying the style in the Controls.xaml
style causes the "Browse for Types" option in the type drop-down combo boxes to stop working. None of the other styles have any impact. To reproduce (in VS2010), create a new WPF application. In the code-behind for the Window1.xaml, import the following namespaces:
using System.Activities; using System.Activities.Presentation; using System.Activities.Core.Presentation;
Then declare two class members:
private DesignerMetadata _designerMetadata; private WorkflowDesigner _designer;
Lastly, add the following lines to the constructor:
_designerMetadata = new DesignerMetadata(); _designerMetadata.Register(); _designer = new WorkflowDesigner(); DesignerGrid.Children.Add(_designer.View); _designer.Load(new ActivityBuilder {Name = "Test Workflow"});
Where DesignerGrid
is the name of the grid layout control at the root of the window.
Apply the resources as mentioned in the MahApps.Metro guide page, and change the Window
to a MetroWindow
.
Run the application, and in the workflow designer, at the bottom of the window, choose "Arguments". Click on the text to "Create a new argument" and an argument with some default settings will be added. Drop down the type combo box, and click on the "Browse for Types..." option. Nothing will happen.
Go back to the resources added to the window and comment out the Controls.xaml
resource. Rerun the application and repeat the steps above. The type browser will now load.
When Dark Theme is activated, Tab headers should turn White instead of Black
It is currently unsigned, that means it can't be used with signed assemblies so it is unusable :(
and the icon click events do not fire too
I would not like to remember the position of some windows which are positioned by my own code to the corner of the screen or in the center. In this case this position memory overrides this.
Hello,
I've notice that samples and other code that reference the WindowCommands tool, which I assume adds the close, maximize, and minimize buttons to the form. I believe this is present in the latest Master branch on GitHub, but not in the NuGet package? Is this a known issue, or am I missing more here?
Thanks,
Patrick
Hi,
the above discribed bug is reproducable by setting ShowTitleBar="False", maximize the window during runtime and then click in any text box, i.e. the user name textbox in the metro demo.
I talked to you on Twitter about this. You told me to create a request for an easier way to add "Settings | About" etc next to the WindowControls.
ContentFontSize is used in a few places, but not defined anywhere. This causes a heap of missing resource warnings.
When the text in a PasswordBox is too long, it dosent scroll to show you the part where the pointer is at, instead, you are able to see the pointer going out of the window.
Image: http://i.imgur.com/5VFXj.png
When setting the MinWidth or MinHeight property of a MetroWindow, the window can still be resized to a smaller size.
May be related to #16.
In the dark themes, selected listview entries are unreadable when listview loses keyboard focus because the background of selected item goes light grey with white text on top. Personally I see no need for a different background colour on loss of kb focus, but could go for a darker grey if people think it is important
The issue is reproduced in MarkPad and in my apps with BorderlessWindowBehavior.
Code52/DownmarkerWPF#94
Since 0.7.9.55-ALPHA the borders of selected buttons, textboxes etc. will appear black, instead of the actual HighlightLightColor/HighlightDarkColor.
MA.M has been all about controls which are one part in creating a great UI, but little to no focus has been put on animations and transitions. I have a few libraries that could be included/referenced, and some demos created to show how to use it in a 'metro'/mvvm style app, but first I'd like your (community) input.
1 - How do people feel about including something to handle animations/transitions?
2 - Does anybody have a preference/suggestion on what libraries (if any) we should use?
When using the Metro style on a GridView inside a ListView, the keyboard navigation doesn't work anymore. Nothing happens when pressing the up/down arrow keys instead of moving through the list of items.
Setting the WindowCommands to {x:Null} will not work as when the template is loaded a default control is created.
I've hit a daft moment and cannot come up with any way to change the background color for a mah:Tile
. I've tried changing the Background color, setting up styles, etc... coming up empty. Any suggestions would be appreciated.
Hi,
can you please sign the lib, before rel-0.5.0.0?
Greets
ResizeMode="NoResize" should:
a) stop the window from resizing
b) remove the resizer grip
c) remove the min/max buttons on the window.
If I create a slider and set its "IsEnabled" property to "False"
<Slider IsEnabled="False" />
I get the following error message:
'HorizontalTrackRectangleDisabledOverlay' name cannot be found in the name scope of 'System.Windows.Controls.Grid'
I've also tried to databind the property to a boolean in my ViewModel, but when the PropertyChanged event fires, but then I get an InvalidOperationException with the above message.
I need to create full screen app without user window move possibility.
I am using:
WindowsSettingBehaviour with ResizeMode="NoResize" WindowStyle="None" WindowState="Maximized" ShowTitleBar="False" ShowCloseButton="False" ShowMinButton="False" ShowMaxRestoreButton="False" Topmost="True"
and BorderlessWindowBehavior.
window move possibility is persist.
Thank you!
It looks like there is a hard coded default window size of 1449x849 (although I can't see where!).
When no Height or width is specified I would expect the window to size to its content. You can reproduce this by simply removing the Height and Width specifications from the xaml for MainWindow in the MetroDemo project.
Win8/Metro has a "date/time" picker set of controls that look like
WPF's inbuilt datetimepicker is garbage. A control (not just restyling) would be needed. There is (for Win8/WinRT) Callisto that implements such a control in XAML/C#, but I haven't checked what it actually looks like yet.
Alternatively, restyling existing third-party controls might be a better approach
This maybe an issue, or maybe I'm just doing it wrong. If you have two panaroma items and a tile for each of those panaroma items. If the name is short for example like "Hello". If you switch to the next one, it will show half of the second paranoma's tile, rather than the full thing. Now if you do something like "Settings", rather than "Hello" it will work. If it's a long one. It will have the same issue.
Also, shouldn't all the tiles be next to each other than a big space, if the name is too long? I don't have access to a WP7, or my W8 demo to confirm.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.