Windows Vista Forums

WPF: Extending the list view (problem using extended object)

  1. #1


    Griff Guest

    WPF: Extending the list view (problem using extended object)

    I have a window with multiple ListViews in them.

    When someone right-clicks on any of the listview items, then I want a
    context menu to appear and one of the options is to copy the data displayed
    to the clipboard.

    For a single listView this is simple - I just use the right-mouse-click
    event. However, as said, I've loads of these listViews and more will be
    added in future, so I don't want to keep creating event handlers for every
    instance.

    So, I decided to go down the inheritance route.

    I created a Class called "ListViewExtClass" which inherits from the
    ListView. I changed the on-right-mouse-click event so that it has the
    necessary code. Now to use it.

    In the XAML <Window/> element, I tried to add the xmlns:local definition.
    When I type in "xmlns:local=" it then gives me a list of options....one of
    which is my project. I select it, so I now end up with
    'xmlns:local="clr-namespace:MyProjectName" '. The only problem is that this
    now displays with a squiggle under it. This expands to say "Assembly
    'MyProjectName' was not found. Verify that you are not missing an assembly
    reference. Also, verify that your project and all reference assemblies have
    been built".

    There are no DLLs etc, so everything is "within" the EXE.

    I clicked on "MyProject" and went to the References tab. In the lower
    listview, I found "MyApplicationName" in the list, but it was unticked. I
    ticked it, but this has not solved the problem. I reversed this change.

    It's something trivial I'm sure, but don't know what it is. All help most
    appreciated.

    Thanks

    Griff



      My System SpecsSystem Spec

  2. #2


    Karsten Schlender Guest

    Re: WPF: Extending the list view (problem using extended object)

    I know this problem in VS 2005, but there it is a mere designer issue,
    compilation should be possible.
    Does this apply to you?

    Karsten

    Griff schrieb:

    > I have a window with multiple ListViews in them.
    >
    > When someone right-clicks on any of the listview items, then I want a
    > context menu to appear and one of the options is to copy the data displayed
    > to the clipboard.
    >
    > For a single listView this is simple - I just use the right-mouse-click
    > event. However, as said, I've loads of these listViews and more will be
    > added in future, so I don't want to keep creating event handlers for every
    > instance.
    >
    > So, I decided to go down the inheritance route.
    >
    > I created a Class called "ListViewExtClass" which inherits from the
    > ListView. I changed the on-right-mouse-click event so that it has the
    > necessary code. Now to use it.
    >
    > In the XAML <Window/> element, I tried to add the xmlns:local definition.
    > When I type in "xmlns:local=" it then gives me a list of options....one of
    > which is my project. I select it, so I now end up with
    > 'xmlns:local="clr-namespace:MyProjectName" '. The only problem is that this
    > now displays with a squiggle under it. This expands to say "Assembly
    > 'MyProjectName' was not found. Verify that you are not missing an assembly
    > reference. Also, verify that your project and all reference assemblies have
    > been built".
    >
    > There are no DLLs etc, so everything is "within" the EXE.
    >
    > I clicked on "MyProject" and went to the References tab. In the lower
    > listview, I found "MyApplicationName" in the list, but it was unticked. I
    > ticked it, but this has not solved the problem. I reversed this change.
    >
    > It's something trivial I'm sure, but don't know what it is. All help most
    > appreciated.
    >
    > Thanks
    >
    > Griff
    >
    >

      My System SpecsSystem Spec

  3. #3


    Griff Guest

    Re: WPF: Extending the list view (problem using extended object)

    Hi Karsten

    Unfortunately not...

    If I create a <ListView Name="abc"/> then this can be found in the code:
    me.abc

    However, if I create <local:ListViewExtended Name="abc"/> then "me.abc"
    errors saying that "abc" is unknown.

    Griff



      My System SpecsSystem Spec

  4. #4


    Griff Guest

    Re: WPF: Extending the list view (problem using extended object)

      My System SpecsSystem Spec

  5. #5


    Radek Cerny Guest

    Re: WPF: Extending the list view (problem using extended object)

    try use x:Name="abc". It might be getting its namespaces confused.

    "Griff" <GriffithsJ_520@xxxxxx> wrote in message
    news:%23xzo11TeIHA.1164@xxxxxx

    > Hi Karsten
    >
    > Unfortunately not...
    >
    > If I create a <ListView Name="abc"/> then this can be found in the code:
    > me.abc
    >
    > However, if I create <local:ListViewExtended Name="abc"/> then "me.abc"
    > errors saying that "abc" is unknown.
    >
    > Griff
    >


      My System SpecsSystem Spec


WPF: Extending the list view (problem using extended object)
Similar Threads
Thread Forum
Extending C: problem. Please help. General Discussion
Monitors cloning, but want extended view. Graphic cards
Sync Center - "Extended Tiles" view option not available Vista General
Extended Tiles View Vista General
Extended Tiles View Vista file management