Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            if (!IsUIEnabled)
            {
                txtDescription.Text = "It looks like something went wrong. The application is disabled. Please contact support.";
            }

            this.DataContext = this;
            NotificationSelection notifications = NotificationManager.GetNotificationSelection();

            // set PreEmptive Analytics to true all the time, because in this example, Dotfuscator will inject the code to do the notifications.
            notifications.PreEmptiveAnalytics = true;
            this.chkPA.DataContext            = notifications;
            this.chkPA.IsEnabled = false;

            // Enable the Application Insights checkbox only if there is an instrumentation key provided.
            // If you have a key, add it in the NotificationManager class.
            this.chkAI.DataContext = notifications;
            this.chkAI.IsEnabled   = NotificationManager.IsAIKeySet;

            this.licenseKeylbl.Content = Wpf.App.LicenseKey;
            this.departmentlbl.Content = Wpf.App.Department;
            this.userNamelbl.Content   = Wpf.App.UserName;

            this.expenseReason.ItemsSource = _reasons;

            submitButtonContent = btnSubmit.Content;
        }