public async void Save(UIElement element, ComboBox devices) { try { ZuneViewDevice selected = (ZuneViewDevice)devices.SelectedItem; FileSavePicker picker = new FileSavePicker { DefaultFileExtension = file_extension, SuggestedFileName = selected.Name, SuggestedStartLocation = PickerLocationId.PicturesLibrary }; picker.FileTypeChoices.Add("Image", new List <string>() { file_extension }); StorageFile file = await picker.PickSaveFileAsync(); if (file != null) { Render(element, file); } } finally { // Ignore Exceptions } }
public void Device(ref ItemsControl display, ref ComboBox devices, ref ComboBox styles) { ZuneViewDevice selected = (ZuneViewDevice)devices.SelectedItem; IEnumerable <ZuneViewStyle> list = _styles.Where(w => w.Types.Contains(selected.Type)); styles.ItemsSource = list; styles.SelectedIndex = 0; SetItem(ref display, ref devices, ref styles); }
private void SetItem(ref ItemsControl display, ref ComboBox devices, ref ComboBox styles) { ZuneViewDevice device = (ZuneViewDevice)devices.SelectedItem ?? _devices.First(); ZuneViewStyle style = (ZuneViewStyle)styles.SelectedItem ?? _styles.First(); display.ItemsSource = new List <ZuneViewDevice>() { new ZuneViewDevice(device.Type, new SolidColorBrush(style.Colour)) }; }