コード例 #1
0
 public MainViewModel()
 {
     try
     {
         using (ApplicationSettingsRepository ctx = new ApplicationSettingsRepository())
         {
             BaseViewModel.Instance.CurrentApplicationSettings = ctx.ApplicationSettings().Result.FirstOrDefault(x => x.Description == "WaterNut");
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #2
0
        private BaseViewModel()
        {
            if (CurrentApplicationSettings == null && LicenseManager.UsageMode != LicenseUsageMode.Designtime)
            {
                using (var ctx = new ApplicationSettingsRepository())
                {
                    CurrentApplicationSettings = ctx.ApplicationSettings().Result.FirstOrDefault();
                }

                if (CurrentApplicationSettings == null)
                {
                    MessageBox.Show("No Default Application Settings Defined");
                }
            }
        }