Esempio n. 1
0
        private void SetupActionCells()
        {
            // Set up switch cells
            autoSessionManagementCell = new SwitchCell {
                Text = "Auto session management",
                On   = true,
            };
            autoSessionManagementCell.OnChanged += (sender, ea) => {
                ApplicationInsights.SetAutoSessionManagementDisabled(!autoSessionManagementCell.On);
            };

            autoPageViewsCell = new SwitchCell {
                Text = "Auto page view tracking",
                On   = true,
            };
            autoPageViewsCell.OnChanged += (sender, ea) => {
                ApplicationInsights.SetAutoPageViewTrackingDisabled(!autoPageViewsCell.On);
            };

            // TODO: also update ApplicationInsights config if input field lost focus
            serverURLCell = new EntryCell()
            {
                Label       = "Server URL",
                Placeholder = "Custom server URL"
            };
            serverURLCell.Completed += (sender, ea) => {
                ApplicationInsights.SetServerUrl(serverURLCell.Text);
            };

            userIDCell = new EntryCell()
            {
                Label       = "User ID",
                Placeholder = "Custom user ID"
            };
            userIDCell.Completed += (sender, ea) => {
                ApplicationInsights.SetUserId(userIDCell.Text);
            };
        }