Post: Tutorial: WPF Design (Ghosts Source | C#)
05-14-2014, 04:47 PM #1
zSunriseModz
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); Hey :p

Today i'm here to write a tutorial of how make your own project in XAML in C# (You can also use vB etc. Is pretty much the same thing like browniezz's source but with a different dll this is MahApps.Metro and since he has release it, i would like to release mine with a tutorial :p) we're going to use my source as reference, but i will start a new project and i'm going to add screenshots (By clicking spoilers).

Let's get started:

Step 1:

- Open Visual Studio

- New Project

- Select C#

- WPF Application

After that, you should get a form looking like this:

You must login or register to view this content.

Step 2:

Now you need to install the MahApps.Metro via the NuGet GUI, right click on your project, click Manage NuGet Packages, select Online and search for MahApps.Metro.

You must login or register to view this content.

Ok, now you need to add the MahApps.Metro.dll as reference like this:

You must login or register to view this content.

Then click "Ok" and we can start with the project Smile

Click on "MainWindow" add "using MahApps.Metro.Controls;" and "MetroWindow"

You must login or register to view this content.

You must login or register to view this content.

You must login or register to view this content.

Double click on "App.xaml" delete this:

You must login or register to view this content.

And add this:

    <Application x:Class="WpfApplication1.App"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>


Now come back on the MainWindow.xaml and change the "<Window, </Window>" to "<controls:MetroWindow, </controls:MetroWindow>" like this:

You must login or register to view this content.

You must login or register to view this content.

Now some example of how to code it in C#. Is the same but with one different thing here some example.

This is the code to create a button:

    <Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="105,134,0,0"/>


in C#:

    private void Button_Click(object sender, RoutedEventArgs e)
{
PS3.AttachProcess();
}


If you want made another button the code is the same, you only need to change the position of it. Now if you want code it you need to change the button code to:

    <Button Name="Button1" Content="Connect PS3" HorizontalAlignment="Left" Margin="275,134,0,0" VerticalAlignment="Top" Width="114" Click="Button1_Click"/>


in C#:

    private void Button1_Click(object sender, RoutedEventArgs e)
{
PS3.AttachProcess();
}


and for the second, third or many as you want to put, just change the "<Button Name="Button1" to Button2, 3, 4 etc.

Same thing with the other things, like for the checkbox is:
    <CheckBox Name="CheckBox1" Content="No Clip" HorizontalAlignment="Left" Margin="543,33,0,0" VerticalAlignment="Top" Checked="CheckBox1_Checked"/>


Just change the number and you've done. Smile

You must login or register to view this content.

You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 11 users say thank you to zSunriseModz for this useful post:

Crunk, DesperateAsshole, HosterModz_, ImPiffHD, KranK, Mx444, oStankyModz, SnaY, xkoeckiiej
05-14-2014, 04:48 PM #2
HosterModz_
Climbing up the ladder
good work Smile
05-14-2014, 04:53 PM #3
SnaY
Former Lead of GS
Originally posted by zSunriseModz View Post
Hey elite users :p

Today i'm here to write a tutorial of how make your own project in XAML in C# (You can also use vB etc. Is pretty much the same thing like browniezz's source but with a different dll this is MahApps.Metro and since he has release it, i would like to release mine with a tutorial :p) we're going to use my source as reference, but i will start a new project and i'm going to add screenshots (By clicking spoilers).

Let's get started:

Step 1:

- Open Visual Studio

- New Project

- Select C#

- WPF Application

After that, you should get a form looking like this:

You must login or register to view this content.

Step 2:

Now you need to install the MahApps.Metro via the NuGet GUI, right click on your project, click Manage NuGet Packages, select Online and search for MahApps.Metro.

You must login or register to view this content.

Ok, now you need to add the MahApps.Metro.dll as reference like this:

You must login or register to view this content.

Then click "Ok" and we can start with the project Smile

Click on "MainWindow" add "using MahApps.Metro.Controls;" and "MetroWindow"

You must login or register to view this content.

You must login or register to view this content.

You must login or register to view this content.

Double click on "App.xaml" delete this:

You must login or register to view this content.

And add this:

    <Application x:Class="WpfApplication1.App"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>


Now come back on the MainWindow.xaml and change the "<Window, </Window>" to "<controls:MetroWindow, </controls:MetroWindow>" like this:

You must login or register to view this content.

You must login or register to view this content.

Now some example of how to code it in C#. Is the same but with one different thing here some example.

This is the code to create a button:

    <Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="105,134,0,0"/>


in C#:

    private void Button_Click(object sender, RoutedEventArgs e)
{
PS3.AttachProcess();
}


If you want made another button the code is the same, you only need to change the position of it. Now if you want code it you need to change the button code to:

    <Button Name="Button1" Content="Connect PS3" HorizontalAlignment="Left" Margin="275,134,0,0" VerticalAlignment="Top" Width="114" Click="Button1_Click"/>


in C#:

    private void Button1_Click(object sender, RoutedEventArgs e)
{
PS3.AttachProcess();
}


and for the second, third or many as you want to put, just change the "<Button Name="Button1" to Button2, 3, 4 etc.

Same thing with the other things, like for the checkbox is:
    <CheckBox Name="CheckBox1" Content="No Clip" HorizontalAlignment="Left" Margin="543,33,0,0" VerticalAlignment="Top" Checked="CheckBox1_Checked"/>


Just change the number and you've done. Smile

You must login or register to view this content.

You must login or register to view this content.


Great man :p

The following user thanked SnaY for this useful post:

zSunriseModz
05-14-2014, 04:54 PM #4
HosterModz_
Climbing up the ladder
Originally posted by SnaY View Post
Great man :p


hello snay
05-14-2014, 04:56 PM #5
zSunriseModz
Climbing up the ladder
Originally posted by HosterModz
good work Smile


Thanks man Smile
05-14-2014, 04:57 PM #6
zSunriseModz
Climbing up the ladder
Originally posted by SnaY View Post
Great man :p


:wub:
05-15-2014, 08:48 AM #7
Shark
Retired.
Originally posted by zSunriseModz View Post
Hey elite users :p

Today i'm here to write a tutorial of how make your own project in XAML in C# (You can also use vB etc. Is pretty much the same thing like browniezz's source but with a different dll this is MahApps.Metro and since he has release it, i would like to release mine with a tutorial :p) we're going to use my source as reference, but i will start a new project and i'm going to add screenshots (By clicking spoilers).

Let's get started:

Step 1:

- Open Visual Studio

- New Project

- Select C#

- WPF Application

After that, you should get a form looking like this:

You must login or register to view this content.

Step 2:

Now you need to install the MahApps.Metro via the NuGet GUI, right click on your project, click Manage NuGet Packages, select Online and search for MahApps.Metro.

You must login or register to view this content.

Ok, now you need to add the MahApps.Metro.dll as reference like this:

You must login or register to view this content.

Then click "Ok" and we can start with the project Smile

Click on "MainWindow" add "using MahApps.Metro.Controls;" and "MetroWindow"

You must login or register to view this content.

You must login or register to view this content.

You must login or register to view this content.

Double click on "App.xaml" delete this:

You must login or register to view this content.

And add this:

    <Application x:Class="WpfApplication1.App"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>


Now come back on the MainWindow.xaml and change the "<Window, </Window>" to "<controls:MetroWindow, </controls:MetroWindow>" like this:

You must login or register to view this content.

You must login or register to view this content.

Now some example of how to code it in C#. Is the same but with one different thing here some example.

This is the code to create a button:

    <Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="105,134,0,0"/>


in C#:

    private void Button_Click(object sender, RoutedEventArgs e)
{
PS3.AttachProcess();
}


If you want made another button the code is the same, you only need to change the position of it. Now if you want code it you need to change the button code to:

    <Button Name="Button1" Content="Connect PS3" HorizontalAlignment="Left" Margin="275,134,0,0" VerticalAlignment="Top" Width="114" Click="Button1_Click"/>


in C#:

    private void Button1_Click(object sender, RoutedEventArgs e)
{
PS3.AttachProcess();
}


and for the second, third or many as you want to put, just change the "<Button Name="Button1" to Button2, 3, 4 etc.

Same thing with the other things, like for the checkbox is:
    <CheckBox Name="CheckBox1" Content="No Clip" HorizontalAlignment="Left" Margin="543,33,0,0" VerticalAlignment="Top" Checked="CheckBox1_Checked"/>


Just change the number and you've done. Smile

You must login or register to view this content.

You must login or register to view this content.


lol all this for a tool design... still good thread I guess.
05-15-2014, 06:38 PM #8
Oh sweet! I'm actually quite bad at coding, and your tutorial seems to hold our hands all the way through the process! Thanks for this, it seems very helpful!
05-16-2014, 12:07 PM #9
zSunriseModz
Climbing up the ladder
Originally posted by NINJA2 View Post
Oh sweet! I'm actually quite bad at coding, and your tutorial seems to hold our hands all the way through the process! Thanks for this, it seems very helpful!


No problem Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo