This project is read-only.

Open new windows

Aug 31, 2013 at 10:16 PM

I've made a function to be triggered on clicking a button. The code is
ModernWindow vWinViewCache = new ModernWindow
    Content = new GclTabAddItemNew(),
The strange this is that the window shown is empty. If I change it to a normal window the layout is correct. the content is a file with this content
<UserControl x:Class="GeoCacheLog.Views.GclAppSettings"
             d:DesignHeight="300" d:DesignWidth="300">
            <StackPanel MinWidth="200">
                <TextBlock Text="TODO: add application page containing the settings" />
Any ideas why this doesn't work?
Sep 1, 2013 at 1:04 PM
The default ModernWindow style ignores the value of the Content property. Content is rendered using a ModernFrame and the ContentSource property. If you need to render plain Content I would suggest using the EmptyWindow style, which does render Content.
var wnd = new ModernWindow {
 Style = (Style)Application.Resources["EmptyWindow"]
Sep 1, 2013 at 2:13 PM
Thanks for the answer and 'hidden' tip :-)

Is so was that today I messed with setting the image source of an image object. Reading your answer I set the ContentSource the same way, but then ofcourse to a xaml file. That works as a charm.