Mahapps.Metro

+2 Chris Blum · September 29, 2014
I really want to learn how to use Mahapps.Metro.
Specifically, I want to use the tabs with the Windows 8 look.

If anyone has experience using this I'd appreciate some help getting started. I haven't made sense of the guide on their website http://mahapps.com/.

I'll also post in this thread some of the controls I learn and how to use them.


<Window x:Class="metroAppsTest.MainWindow"



xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

xmlns:Behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

<i:Interaction.Behaviors>

<Behaviours:BorderlessWindowBehavior/>

</i:Interaction.Behaviors>

Title="Trainee Progress Report" Height="891.531" Width="1796.173" BorderThickness="0" BorderBrush="#FF0F0F0F" Background="#FF3B3D42" WindowStyle="ThreeDBorderWindow"/>

In the <I:Interaction.Behaviors> I'm getting "an attribute name is missing"
In the guide it only says to add this code to the window tag.

Post a Reply

Replies

Oldest  Newest  Rating
+1 Eugene Botma · September 30, 2014
I am not familiar with the framework, but a quick look at the guides tell me it's one of 2 issues (or both).

xml works a lot like html, for anything with child controls, you need a opening and closing tag, so your window should look something like below. I would guess that the <i> tags should then be inside the content of the windows, not inside the tag. For example:


<Window x:Class="metroAppsTest.MainWindow"



xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

xmlns:Behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Title="Trainee Progress Report" Height="891.531" Width="1796.173" BorderThickness="0" BorderBrush="#FF0F0F0F" Background="#FF3B3D42" WindowStyle="ThreeDBorderWindow">

<!-- Child controls and content here -->


<i:Interaction.Behaviors>

<Behaviours:BorderlessWindowBehavior/>

</i:Interaction.Behaviors>


</Window>



From the error message, i'm guessing that you need something in the tags to complete them. Maybe add an option to the behaviors tag.


<i:Interaction.Behaviors>
       <Behaviours:BorderlessWindowBehavior ResizeWithGrip="False"/>
</i:Interaction.Behaviors>
0 Chris Blum · September 30, 2014
Eugene,
You are correct!
I removed the closing tag from
Title="Trainee Progress Report" Height="891.531" Width="1796.173" BorderThickness="0" BorderBrush="#FF0F0F0F" Background="#FF3B3D42" WindowStyle="ThreeDBorderWindow">

 and added </Window> and the error is gone.

Now to get this thing set up looking nice ANNNNND hope my chart code works inside of all this.

Thanks for the help!!!
  • 1

C#

107,115 followers
About

C# is an object-oriented language designed for improving the development of web applications.

Links
Moderators