These are chat archives for punker76/MahApps.Metro.SimpleChildWindow

24th
Dec 2014
Paolo Ghibaudo
@ghiboz
Dec 24 2014 09:18
hi @punker76 ! I'm trying to implement your SimpleChildWindow... I have a question: I've tried a simple sample and it works, but now I wish transform my old MetroWindow class into a SimpleChildWindow.. it's possible?
actually my code is this:
new Car.carPaint().ShowDialog();
where carPaint is:
<Controls:MetroWindow x:Class="gRally.Drive.Car.carPaint"
Jan Karger
@punker76
Dec 24 2014 10:02
yes, why not, it's a ContentControl. Change simply the MetroWindow by ChildWindow (also at code behind)
you can then usw the ChildWindowManager to show the child Windows
here is a simple example in my player
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:06
tnx and for the <Window.Resources> ?
<local:ChildWindow.Resources>...
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:09
and local how is declared ?
(is in italian.. but I wish let you hear this song :))
Jan Karger
@punker76
Dec 24 2014 10:11
i just noticed by myself that we need a DialogResult ;-)
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:11
lol
yeah, it's cool :)
Jan Karger
@punker76
Dec 24 2014 10:11
local is the definition for the xmlns
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:12
I've this:
<simpleChildWindow:ChildWindow  x:Class="gRally.Drive.Car.carPaint"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:simpleChildWindow="clr-namespace:MahApps.Metro.SimpleChildWindow;assembly=MahApps.Metro.SimpleChildWindow"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:xceed="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
        xmlns:xceedConvert="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters;assembly=Xceed.Wpf.Toolkit"
        xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        Title="carPaint" Height="683" Width="510" >
Jan Karger
@punker76
Dec 24 2014 10:13
looks good xmlns:simpleChildWindow
but System.Windows.Forms ? ;-)
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:17
I need it to create a System.Windows.Forms.Panel to use the handle to paint my 3d scene
Jan Karger
@punker76
Dec 24 2014 10:19
ok
your song sounds good, but i understand nothing :-D
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:19
eheheh
Jan Karger
@punker76
Dec 24 2014 10:19
is it from your Band?
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:19
yes
Jan Karger
@punker76
Dec 24 2014 10:20
good work
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:21
thanks very much Jan!
Jan Karger
@punker76
Dec 24 2014 10:23
when will gRally come out? ;-)
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:24
I don't know... the things to do are too much, and I do this in my spare time
I hope in 2015 to release a playable beta
how can I make 'visibile' the ((MetroWindow)Application.Current.MainWindow).ShowChildWindowAsync ?
Jan Karger
@punker76
Dec 24 2014 10:28
private async Task ShowEqualizer()
{
this.equalizerView = new EqualizerView() { ViewModel = new EqualizerViewModel(this.PlayerEngine.Equalizer) };
this.equalizerView.ClosingFinished += (sender, args) => this.equalizerView = null;
await ((MetroWindow)Application.Current.MainWindow).ShowChildWindowAsync(equalizerView);
}
Paolo Ghibaudo
@ghiboz
Dec 24 2014 10:29
Error 23 'MahApps.Metro.Controls.MetroWindow' does not contain a definition for 'ShowChildWindowAsync' and no extension method 'ShowChildWindowAsync' accepting a first argument of type 'MahApps.Metro.Controls.MetroWindow' could be found (are you missing a using directive or an assembly reference?) C:\ghiboz\gitProjects\gRally\gRallyMenu_\Drive\ucnDrive.xaml.cs 172 gRally
This message was deleted
I see that you like 'die toten hosen' :)
Jan Karger
@punker76
Dec 24 2014 11:04
do you include the MahApps.Metro.SimpleChildWimdow dll?
Paolo Ghibaudo
@ghiboz
Dec 24 2014 11:05
yes, i've installed from nuget
Jan Karger
@punker76
Dec 24 2014 11:12
i mean the uses at your code behind
Jan Karger
@punker76
Dec 24 2014 11:13
you need this AS uses in your code behind too
unker76 2 days ago change equalizer to Reactive
1 contributor
289 lines (256 sloc) 10.142 kb RawBlameHistory
using System.Linq;
using System.Net.Mime;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using MahApps.Metro.Controls;
using MahApps.Metro.SimpleChildWindow;
e.g.
Paolo Ghibaudo
@ghiboz
Dec 24 2014 11:16
into MainWindow.xaml.cs?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MahApps.Metro;
using MahApps.Metro.Controls;
using System.Windows.Threading;
using System.Windows.Interop;
using MahApps.Metro.SimpleChildWindow;
using System.Net.Mime;
using System.Threading.Tasks;
Jan Karger
@punker76
Dec 24 2014 11:18
where you use the ShowChildWindowAsync
Paolo Ghibaudo
@ghiboz
Dec 24 2014 11:18
wow
:+1:
Jan Karger
@punker76
Dec 24 2014 11:21
yeah
Paolo Ghibaudo
@ghiboz
Dec 24 2014 11:22
now I need to make it better (the 'shadow') and make an ok/cancel to manage the future feature of DialogResult :D
Jan Karger
@punker76
Dec 24 2014 11:25
ah i see, you must replace Width and Height properties by ChildWindowWidth and ChildWindowHeight
now it's COOL
Paolo Ghibaudo
@ghiboz
Dec 24 2014 14:21
thanks for all @punker76 ! now I leave the office.. it's time to holiday :D merry Christmas and see you soon ;)
Jan Karger
@punker76
Dec 24 2014 14:28
thx, and the same to you!
Paolo Ghibaudo
@ghiboz
Dec 24 2014 14:28
;)