private void LoadSnippetOptions() { foreach (SnippetOptions options in SnippetOptions.LoadAvailableOptions()) { MenuItem item = new MenuItem(); item.Header = options.Name; item.IsCheckable = true; item.Tag = options; item.Checked += HandleOptionsSelection; item.IsChecked = false; OptionsMenu.Items.Add(item); } ((MenuItem)OptionsMenu.Items[0]).IsChecked = true; }
private void LoadSnippetOptions() { foreach (SnippetOptions options in SnippetOptions.LoadAvailableOptions()) { MenuItem item = new MenuItem(); item.Header = options.Name; item.IsCheckable = true; item.Tag = options; item.Checked += HandleOptionsSelection; item.IsChecked = false; OptionsMenu.Items.Add(item); } // Default to the last option... OptionsMenu.Items.Cast <MenuItem>().Last().IsChecked = true; }