Click here to Skip to main content
15,886,693 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Conversion of vb.net to java Pin
Guffa5-Feb-08 1:24
Guffa5-Feb-08 1:24 
GeneralThe property grid in the WPF designer Pin
jesarg4-Feb-08 11:47
jesarg4-Feb-08 11:47 
GeneralRe: The property grid in the WPF designer Pin
TJoe5-Feb-08 2:39
TJoe5-Feb-08 2:39 
GeneralRe: The property grid in the WPF designer Pin
jesarg5-Feb-08 5:24
jesarg5-Feb-08 5:24 
GeneralRe: The property grid in the WPF designer Pin
TJoe5-Feb-08 5:30
TJoe5-Feb-08 5:30 
QuestionCleaning up resouces in a WPF application Pin
Simon P Stevens4-Feb-08 3:46
Simon P Stevens4-Feb-08 3:46 
AnswerRe: Cleaning up resouces in a WPF application Pin
TJoe5-Feb-08 2:55
TJoe5-Feb-08 2:55 
GeneralRe: Cleaning up resouces in a WPF application Pin
Simon P Stevens5-Feb-08 23:15
Simon P Stevens5-Feb-08 23:15 
The problem won't be solved by implementing the dispose pattern on the window, I will still be left with a window class that doesn't get disposed as there is nowwhere to call dispose on the Window from.

In WPF the entry point is auto generated and looks like this:

/// <summary><br />
        /// Application Entry Point.<br />
        /// </summary><br />
        [System.STAThreadAttribute()]<br />
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]<br />
        public static void Main() {<br />
            WpfApplication1.App app = new WpfApplication1.App();<br />
            app.InitializeComponent();<br />
            app.Run();<br />
        }


(No window class anywhere), and the app.xml file looks like this

<Application x:Class="WpfApplication1.App"<br />
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
    StartupUri="Window1.xaml"><br />
    <Application.Resources><br />
         <br />
    </Application.Resources><br />
</Application>


I don't have control over the creation of the window class, and it won't get disposed of. I tried it, and all that happens is the finaliser gets triggered when the app is closed.

What I've done for now is to manually implement the app entry point so I have control over the window creation:

public static void Main()<br />
        {<br />
            WpfApplication1.App app = new WpfApplication1.App();<br />
            using (Window1 mainWindow = new Window1())<br />
            {<br />
                app.Run(mainWindow );<br />
            }<br />
        }


But this doesn't quite feel like the 'WPF way'. I have no app.xaml file.

Is there a way of doing this without manually implementing the the app entry point, or is this how it should be done?

It's a minor point really, It works fine the way I've done it, just I wondered if there's a proper way of doing it.

Simon

GeneralRe: Cleaning up resouces in a WPF application Pin
TJoe6-Feb-08 2:14
TJoe6-Feb-08 2:14 
GeneralRe: Cleaning up resouces in a WPF application Pin
Simon P Stevens6-Feb-08 10:33
Simon P Stevens6-Feb-08 10:33 
GeneralXAML/WPF rotation of a textbox Pin
Don Rolando3-Feb-08 22:57
Don Rolando3-Feb-08 22:57 
GeneralRe: XAML/WPF rotation of a textbox Pin
TJoe4-Feb-08 9:45
TJoe4-Feb-08 9:45 
GeneralMessage box in asp.net Pin
Milind Panchal1-Feb-08 23:22
Milind Panchal1-Feb-08 23:22 
GeneralRe: Message box in asp.net Pin
pmarfleet2-Feb-08 4:51
pmarfleet2-Feb-08 4:51 
GeneralRe: Message box in asp.net Pin
Navdeep Bhardwaj4-Feb-08 23:34
Navdeep Bhardwaj4-Feb-08 23:34 
GeneralRegarding certification....... Pin
tasumisra31-Jan-08 19:34
tasumisra31-Jan-08 19:34 
GeneralRe: Regarding certification....... Pin
pmarfleet1-Feb-08 23:12
pmarfleet1-Feb-08 23:12 
AnswerRe: Regarding certification....... Pin
Vasudevan Deepak Kumar5-Feb-08 22:09
Vasudevan Deepak Kumar5-Feb-08 22:09 
GeneralMonitor creation of threads or message queues Pin
schwiemn31-Jan-08 13:44
schwiemn31-Jan-08 13:44 
GeneralRe: Monitor creation of threads or message queues Pin
S. Senthil Kumar1-Feb-08 19:21
S. Senthil Kumar1-Feb-08 19:21 
GeneralWCF Pin
hichamveo31-Jan-08 11:07
hichamveo31-Jan-08 11:07 
GeneralRe: WCF Pin
Joachim Kerschbaumer6-Feb-08 4:07
Joachim Kerschbaumer6-Feb-08 4:07 
QuestionYour thoughts about .Net Reactor Pin
Jiaan31-Jan-08 8:29
Jiaan31-Jan-08 8:29 
GeneralRe: Your thoughts about .Net Reactor Pin
Mark Churchill1-Feb-08 3:18
Mark Churchill1-Feb-08 3:18 
GeneralRe: Your thoughts about .Net Reactor Pin
Jiaan1-Feb-08 3:30
Jiaan1-Feb-08 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.