/// <summary> /// Sets the contrast scheme to the given value. /// </summary> /// <param name="contrastScheme">The contrast scheme to use.</param> public override void SetContrast(ContrastLevel contrastScheme) { try { HtmlPage.Window.CreateInstance("SetContrastClass", contrastScheme.ToString()); } catch(Exception) { } }
/// <summary> /// Changes the contrast level of the surface. Typically this is a matter of /// changing the background and foreground colours. This could be acheived by /// setting CSS classes on the DivContainer. /// </summary> /// <param name="contrast">The contrast level to set on the surface.</param> public override void SetContrast(ContrastLevel level) { Container.CssClass = level.ToString(); }
// Public Methods (2) /// <summary> /// Updates the reported contrast scheme in the display settings. Called by the Presenter. /// </summary> /// <param name="contrastScheme">The contrast scheme.</param> public void UpdateContrastScheme(ContrastLevel contrastScheme) { ListBoxItem selectedItem = (ListBoxItem)contrastSchemeSelector.Items.FirstOrDefault( currentItem => ((ListBoxItem)currentItem).Tag.ToString() == contrastScheme.ToString()); //Don't want the event to fire to re-update this in the Model. contrastSchemeSelector.SelectionChanged -= contrastSchemeSelectionChanged; if(selectedItem != null) { contrastSchemeSelector.SelectedItem = selectedItem; } contrastSchemeSelector.SelectionChanged += contrastSchemeSelectionChanged; }