Startup Window based on Properties.Default values - WPF

I have to open different window based on default values.Following is the code:

---------------------------------

public void ChooseNextWindowBasedOnDefaultValue()
{
if (Settings.Default["DsrType"] == null || Settings.Default["DsrType"].ToString() == "" || Settings.Default["TimeSlot"].ToString() == "")
{
ShowMainWindow();
}

else if (Settings.Default["DsrType"].ToString().ToLower() == "excel")
{
ShowLoadExcelWindow();
}

else if (Settings.Default["DsrType"].ToString().ToLower() == "texteditor")
{
ShowTextEditorWindow();
}
}

---------------------------------------

Everything works fine in my local machine. When i install the setup in others machine and tried to run, no window is starting. where it went wrong? i think i couldn't read Default values in others machine.

6 Replies

KJ Keerthana Jegannathan Syncfusion Team September 12, 2017 09:27 AM UTC

Hi Mahesh, 
 
Thank you for contacting Syncfusion support. 
 
From your update, we suspect that you are trying to load the different types of windows based on certain condition. In your code, you have checked the specific settings for condition. So can you share more details about the settings which you are used? Also, as you mentioned that your setup is not running in other machines, please share the configuration details of your local machine.  If possible also share the simple sample which replicates the issue you are facing? That will helps us to analyze and provide the solution at earliest. 
 
Regards, 
Keerthana J 



KJ Keerthana Jegannathan Syncfusion Team September 12, 2017 09:28 AM UTC

 Hi Mahesh,


Thank you for contacting Syncfusion support.


From your update, we suspect that you are trying to load the different types of windows based on certain condition. In your code, you have checked the specific settings for condition. So can you share more details about the settings which you are used? Also, as you mentioned that your setup is not running in other machines, please share the configuration details of your local machine. If possible also share the simple sample which replicates the issue you are facing? That will helps us to analyze and provide the solution at earliest.


Regards,

Keerthana J
 



MN Magesh N September 13, 2017 08:07 AM UTC

Hi Keerthana,


What you have suspected is correct. Based on default values, different windows will load. I have attached my code for window startup(StartuWindow.cs) and MainWindow(MainWindow.cs).In MainWindow.cs,i will override the default values.


Attachment: MainWindow.xaml_(2)_97f877f.zip


KJ Keerthana Jegannathan Syncfusion Team September 14, 2017 12:43 PM UTC

Hi Mahesh, 
 
Thanks for your update. 
 
We have checked your reported case by creating simple sample but we were unable to reproduce the reported behavior. Please find the sample which we have checked from below location 
 
 
We suspect that Settings of your application is not properly configured in other machines , so can you please ensure whether your default settings are loaded in the machines where you installed this setup? Based on your update, we will proceed further on this. 
 
Regards, 
Keerthana J  



MN Magesh N September 26, 2017 09:01 AM UTC

Hi Keerthana,

I couldn't trace the problem. The sample you gave works fine.

In my local machine, setup gets installed and when i launch my application, it shows the window based on my default parameters.

In others machine, Setup is getting installed, the problem is when i launch my application, no window is displaying in UI.

I have attached my solution and setup file(.exe of my solution) for your reference.


Attachment: SolutionAndSetup_a7fbe768.zip


KJ Keerthana Jegannathan Syncfusion Team September 27, 2017 01:17 PM UTC

 
Hi Mahesh, 
 
Thanks for your update. 
 
We were able to run your updated sample, but we are facing error in installing your shared setup in our machine. 
 
Regards, 
Keerthana J 


Loader.
Up arrow icon