Click here to Skip to main content
15,909,091 members
Home / Discussions / WPF
   

WPF

 
QuestionWhat is killing all WPF command CanExecutes? Pin
artwallacex24-Jun-08 13:41
artwallacex24-Jun-08 13:41 
AnswerRe: What is killing all WPF command CanExecutes? Pin
RNEELY27-Jun-08 7:33
RNEELY27-Jun-08 7:33 
GeneralRe: What is killing all WPF command CanExecutes? Pin
artwallacex27-Jun-08 11:03
artwallacex27-Jun-08 11:03 
GeneralRe: What is killing all WPF command CanExecutes? Pin
RNEELY27-Jun-08 13:38
RNEELY27-Jun-08 13:38 
GeneralRe: What is killing all WPF command CanExecutes? Pin
artwallacex27-Jun-08 14:07
artwallacex27-Jun-08 14:07 
QuestionWrapping a WPF GUI component to use it with a HID different than mouse? Pin
Member 367304824-Jun-08 7:07
Member 367304824-Jun-08 7:07 
QuestionMaking Refresh on Viewport3D Pin
sondos0123-Jun-08 23:46
sondos0123-Jun-08 23:46 
QuestionLoading DWF/DXF/DWG file Pin
Member 384581521-Jun-08 0:15
Member 384581521-Jun-08 0:15 
AnswerRe: Loading DWF/DXF/DWG file Pin
Pete O'Hanlon21-Jun-08 0:51
mvePete O'Hanlon21-Jun-08 0:51 
AnswerRe: Loading DWF/DXF/DWG file Pin
wout de zeeuw1-May-11 10:37
wout de zeeuw1-May-11 10:37 
QuestionSingleInstance Application Pin
Jammer20-Jun-08 9:21
Jammer20-Jun-08 9:21 
AnswerRe: SingleInstance Application Pin
Pete O'Hanlon20-Jun-08 9:44
mvePete O'Hanlon20-Jun-08 9:44 
QuestionRe: SingleInstance Application [modified] Pin
Jammer20-Jun-08 12:25
Jammer20-Jun-08 12:25 
AnswerRe: SingleInstance Application Pin
Pete O'Hanlon21-Jun-08 0:49
mvePete O'Hanlon21-Jun-08 0:49 
GeneralRe: SingleInstance Application Pin
Jammer21-Jun-08 7:06
Jammer21-Jun-08 7:06 
GeneralRe: SingleInstance Application Pin
Pete O'Hanlon22-Jun-08 8:39
mvePete O'Hanlon22-Jun-08 8:39 
Jammer - here's a quick sample for you to try out:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Threading;

namespace SingleInstanceApp
{
  public class SIApplication : Application
  {
    private static bool isNew;
    [STAThread]
    public static void Main()
    {
      using (Mutex m = new Mutex(true, "SIApplication.Mutex", out isNew))
      {
        if (isNew)
        {
          SIApplication app = new SIApplication();
          app.InitializeComponent();
          app.Run();
        }
      }
    }

    public void InitializeComponent()
    {
      this.StartupUri = new Uri("Window1.xaml", System.UriKind.Relative);
    }
  }
}
Predictably, you need to set the startup object to point to this class. The trick is that you physically aren't going to create any other instances of the app because you have detected the state of the mutex before you create an instance of the app. BTW - you really need to use the StartupUri, I suspect this is where you've been getting your problems.

Deja View - the feeling that you've seen this post before.

My blog | My articles



GeneralRe: SingleInstance Application Pin
Jammer22-Jun-08 23:43
Jammer22-Jun-08 23:43 
GeneralRe: SingleInstance Application Pin
Pete O'Hanlon23-Jun-08 0:02
mvePete O'Hanlon23-Jun-08 0:02 
GeneralRe: SingleInstance Application Pin
Jammer23-Jun-08 0:41
Jammer23-Jun-08 0:41 
GeneralRe: SingleInstance Application Pin
Jammer20-Jun-08 13:20
Jammer20-Jun-08 13:20 
AnswerRe: SingleInstance Application Pin
RNEELY27-Jun-08 7:43
RNEELY27-Jun-08 7:43 
QuestionBrain hits wall - WPF Help Please Pin
Rei Roldan19-Jun-08 7:54
Rei Roldan19-Jun-08 7:54 
AnswerRe: Brain hits wall - WPF Help Please Pin
Gideon Engelberth19-Jun-08 10:12
Gideon Engelberth19-Jun-08 10:12 
GeneralRe: Brain hits wall - WPF Help Please Pin
Rei Roldan19-Jun-08 10:21
Rei Roldan19-Jun-08 10:21 
GeneralRe: Brain hits wall - WPF Help Please Pin
Paul Conrad21-Jun-08 4:05
professionalPaul Conrad21-Jun-08 4:05 

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.