private void FileSelectButton_Click(object sender, RoutedEventArgs e) { FileDialog dialog = new OpenFileDialog() { Filter = GetImageFileFilter() }; bool?result = dialog.ShowDialog(); if (result ?? false) { SkinProperty prop = (SkinProperty)(sender as FrameworkElement).Tag; prop.Value = dialog.FileName; } }
public void SetValue <T>(string name, T value) { var prop = _properties.FirstOrDefault(x => x.Name == name && x is SkinProperty <T>) as SkinProperty <T>; if (prop != null) { prop.Value = value; } else { prop = new SkinProperty <T>(name, value); _properties.Add(prop); } }
private void FileClearButton_Click(object sender, RoutedEventArgs e) { SkinProperty prop = (SkinProperty)(sender as FrameworkElement).Tag; prop.Value = null; }