Click here to Skip to main content
15,879,326 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF Geometry Question Pin
Kevin Marois9-May-19 10:25
professionalKevin Marois9-May-19 10:25 
QuestionDataGrid Binding Problem Pin
Kevin Marois29-Apr-19 17:37
professionalKevin Marois29-Apr-19 17:37 
AnswerRe: DataGrid Binding Problem Pin
Gerry Schmitz29-Apr-19 18:22
mveGerry Schmitz29-Apr-19 18:22 
GeneralRe: DataGrid Binding Problem Pin
Kevin Marois30-Apr-19 4:34
professionalKevin Marois30-Apr-19 4:34 
GeneralRe: DataGrid Binding Problem Pin
Gerry Schmitz30-Apr-19 5:43
mveGerry Schmitz30-Apr-19 5:43 
GeneralRe: DataGrid Binding Problem Pin
Kevin Marois30-Apr-19 6:47
professionalKevin Marois30-Apr-19 6:47 
GeneralRe: DataGrid Binding Problem Pin
Gerry Schmitz30-Apr-19 21:46
mveGerry Schmitz30-Apr-19 21:46 
AnswerRe: DataGrid Binding Problem Pin
Mycroft Holmes29-Apr-19 21:19
professionalMycroft Holmes29-Apr-19 21:19 
GeneralRe: DataGrid Binding Problem Pin
Kevin Marois30-Apr-19 4:35
professionalKevin Marois30-Apr-19 4:35 
GeneralRe: DataGrid Binding Problem Pin
Mycroft Holmes30-Apr-19 12:25
professionalMycroft Holmes30-Apr-19 12:25 
AnswerRe: DataGrid Binding Problem Pin
Richard Deeming1-May-19 8:32
mveRichard Deeming1-May-19 8:32 
QuestionBinding "SelectedItems" of a Listbox Pin
Jayme6524-Mar-19 1:15
Jayme6524-Mar-19 1:15 
AnswerRe: Binding "SelectedItems" of a Listbox Pin
Gerry Schmitz24-Mar-19 6:15
mveGerry Schmitz24-Mar-19 6:15 
QuestionMicrosoft Documentation Pin
RichardChiles8-Mar-19 12:41
RichardChiles8-Mar-19 12:41 
AnswerRe: Microsoft Documentation Pin
Richard Deeming8-Mar-19 13:35
mveRichard Deeming8-Mar-19 13:35 
GeneralRe: Microsoft Documentation Pin
RichardChiles8-Mar-19 13:46
RichardChiles8-Mar-19 13:46 
GeneralRe: Microsoft Documentation Pin
Richard Deeming11-Mar-19 9:03
mveRichard Deeming11-Mar-19 9:03 
QuestionPlot LineSeries with out point Markers. Pin
RichardChiles8-Mar-19 12:39
RichardChiles8-Mar-19 12:39 
Questiondynamic tabitems with dynamic buttons in each tabitem Pin
siebren beens4-Mar-19 1:47
siebren beens4-Mar-19 1:47 
AnswerRe: dynamic tabitems with dynamic buttons in each tabitem Pin
Super Lloyd6-Mar-19 12:18
Super Lloyd6-Mar-19 12:18 
QuestionEnum Filtering Pin
Kevin Marois27-Feb-19 12:58
professionalKevin Marois27-Feb-19 12:58 
AnswerRe: Enum Filtering Pin
Richard Deeming28-Feb-19 1:28
mveRichard Deeming28-Feb-19 1:28 
Try something like this:
C#
public class EnumExcludeFilterConverter : IValueConverter
{
    private static readonly char[] Separators = { ';' };
    
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        string filters = parameter == null ? String.Empty : parameter.ToString();
        if (string.IsNullOrWhiteSpace(filters)) return value;
        
        Array allValues = value as Array;
        if (allValues == null || allValues.Length == 0) return value;
        
        Type enumType = value.GetType().GetElementType();
        if (!enumType.IsEnum) return value;
        
        ICollection<string> splitFilters = filters.Split(Separators, StringSplitOptions.RemoveEmptyEntries);
        if (splitFilters.Count == 0) return value;

        List<Enum> result = new List<Enum>(allValues.Length);
        foreach (Enum item in allValues)
        {
            string itemName = Enum.GetName(enumType, item);
            if (!splitFilters.Contains(itemName))
            {
                result.Add(item);
            }
        }
        
        return result;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Enum Filtering Pin
Kevin Marois28-Feb-19 4:13
professionalKevin Marois28-Feb-19 4:13 
QuestionListBox with Hyperlinks Problem Pin
Kevin Marois24-Feb-19 8:41
professionalKevin Marois24-Feb-19 8:41 
AnswerRe: ListBox with Hyperlinks Problem Pin
Gerry Schmitz24-Feb-19 9:21
mveGerry Schmitz24-Feb-19 9:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.