Click here to Skip to main content
14,384,957 members

Silverlight / WPF

 
QuestionEnum Filtering Pin
Kevin Marois27-Feb-19 13:58
professionalKevin Marois27-Feb-19 13:58 
AnswerRe: Enum Filtering Pin
Richard Deeming28-Feb-19 2:28
mveRichard Deeming28-Feb-19 2:28 
GeneralRe: Enum Filtering Pin
Kevin Marois28-Feb-19 5:13
professionalKevin Marois28-Feb-19 5:13 
QuestionListBox with Hyperlinks Problem Pin
Kevin Marois24-Feb-19 9:41
professionalKevin Marois24-Feb-19 9:41 
AnswerRe: ListBox with Hyperlinks Problem Pin
Gerry Schmitz24-Feb-19 10:21
mveGerry Schmitz24-Feb-19 10:21 
GeneralRe: ListBox with Hyperlinks Problem Pin
Kevin Marois27-Feb-19 5:53
professionalKevin Marois27-Feb-19 5:53 
AnswerRe: ListBox with Hyperlinks Problem Pin
Richard Deeming27-Feb-19 9:00
mveRichard Deeming27-Feb-19 9:00 
QuestionHow to solve erroneous designer intellisense error report Pin
Super Lloyd26-Jan-19 20:29
memberSuper Lloyd26-Jan-19 20:29 
In my utility WPF library I (reinvented the wheel, yeah yeah, I know..) created a Behaviors attached property of type BehaviorList.
static DependencyPropertyKey BehaviorsKey = DependencyProperty.RegisterAttachedReadOnly(
    "PrivateBehaviors", // REMARK: name is different from property to force GetBehaviors() call
    typeof(BehaviorList),
    typeof(Behavior),
    new UIPropertyMetadata(null));

public static DependencyProperty BehaviorsProperty = BehaviorsKey.DependencyProperty;

public static BehaviorList GetBehaviors(DependencyObject target)
{
    var result = (BehaviorList)target.GetValue(BehaviorsProperty);
    if (result == null)
    {
        result = new BehaviorList(target);
        target.SetValue(BehaviorsKey, result);
    }
    return result;
}

then I used this property in XAML to add my own custome behavior type:
<Slider>
    <gx:Behavior.Behaviors>
        <local:DragLayerGroupBehavior/>
    </gx:Behavior.Behaviors>
</Slider>

and here are the class involved
public class BehaviorList : IList<Behavior>, System.Collections.IList
{
// .....
}

public class DragLayerGroupBehavior : Behavior
{
// .....
}

This works well and good (at runtime) but the designer has red underlines and show the following errors:
Error XLS0503,  A value of type 'DragLayerGroupBehavior' cannot be added to a collection or dictionary of type 'BehaviorList'.
Error XDG0048,  The specified value cannot be assigned to the collection. The following type was expected: "Behavior".

So the question is, how to "solve" those errors, i.e. unconfused VisualStudio WPF designer?
Is there a particular interface I need to implement, some attribute to use, or something?
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!

AnswerRe: How to solve erroneous designer intellisense error report Pin
Gerry Schmitz28-Jan-19 9:24
mveGerry Schmitz28-Jan-19 9:24 
GeneralRe: How to solve erroneous designer intellisense error report Pin
Super Lloyd28-Jan-19 15:42
memberSuper Lloyd28-Jan-19 15:42 
QuestionHave two controls fill the MainWindow and resize automatically Pin
Mc_Topaz16-Jan-19 5:14
memberMc_Topaz16-Jan-19 5:14 
AnswerRe: Have two controls fill the MainWindow and resize automatically Pin
Richard Deeming16-Jan-19 9:07
mveRichard Deeming16-Jan-19 9:07 
GeneralRe: Have two controls fill the MainWindow and resize automatically Pin
Mc_Topaz16-Jan-19 20:22
memberMc_Topaz16-Jan-19 20:22 
QuestionHyperlink Context Menu Pin
Kevin Marois9-Jan-19 16:30
professionalKevin Marois9-Jan-19 16:30 
AnswerRe: Hyperlink Context Menu Pin
Richard Deeming10-Jan-19 1:32
mveRichard Deeming10-Jan-19 1:32 
GeneralRe: Hyperlink Context Menu Pin
Kevin Marois10-Jan-19 5:32
professionalKevin Marois10-Jan-19 5:32 
GeneralRe: Hyperlink Context Menu Pin
Kevin Marois10-Jan-19 6:31
professionalKevin Marois10-Jan-19 6:31 
QuestionTreeView Item Show Button Using Trigger Pin
Kevin Marois1-Jan-19 12:41
professionalKevin Marois1-Jan-19 12:41 
AnswerRe: TreeView Item Show Button Using Trigger Pin
Gerry Schmitz5-Jan-19 8:22
mveGerry Schmitz5-Jan-19 8:22 
GeneralRe: TreeView Item Show Button Using Trigger Pin
Kevin Marois7-Jan-19 8:31
professionalKevin Marois7-Jan-19 8:31 
GeneralRe: TreeView Item Show Button Using Trigger Pin
Gerry Schmitz7-Jan-19 9:39
mveGerry Schmitz7-Jan-19 9:39 
GeneralRe: TreeView Item Show Button Using Trigger Pin
Kevin Marois7-Jan-19 10:18
professionalKevin Marois7-Jan-19 10:18 
GeneralRe: TreeView Item Show Button Using Trigger Pin
J. Calhoun14-Feb-19 5:37
memberJ. Calhoun14-Feb-19 5:37 
QuestionWPF Items Source get the visible items Pin
Paul M Gibson31-Dec-18 8:00
memberPaul M Gibson31-Dec-18 8:00 
AnswerRe: WPF Items Source get the visible items Pin
Gerry Schmitz1-Jan-19 7:42
mveGerry Schmitz1-Jan-19 7:42 

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.