1

I am re-developing a WPF application and the application makes use of the following 2 assemblies as it uses separate components from each:

WPFToolkit and PresentationFramework.

In my Xaml.cs I have used extern alias to use the namespace System.Windows.TemplateVisualState and that is all good and well, my question is in my Xaml.xaml, how would I differentiate between WPFToolkit.System.Windows.TemplateVisualState and PresentationFramework.System.Windows.TemplateVisualState?

Below is the top part of my Xaml:

 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:local="clr-namespace:CAIS2"
 xmlns:CodeLib="clr-namespace:CodeLib;assembly=CodeLib"
 xmlns:CAISCommon="clr-namespace:CAISCommon;assembly=CAISCommon"  >

Here is where Resharper is complaining:

 <VisualStateManager.VisualStateGroups>
     <VisualStateGroup x:Name="LoginStates">
         <Windows:VisualState x:Name="LoggedOut">
             ......
BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • Update: The actual error message is below: The type 'System.Windows.VisualStateGroup' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll' and 'c:\Program Files (x86)\WPF Toolkit\v3.5.50211.1\WPFToolkit.dll' – Charles Trent Jun 14 '12 at 13:20
  • 1
    I think this is the same problem that was answered [here][1] [1]: http://stackoverflow.com/questions/6949651/ambiguous-type-reference-a-type-named-visualstate-occurs-in-at-least-two-name – Andy Jun 14 '12 at 13:38

1 Answers1

0

It looks like you've got a namespace set up for the WPF toolkit already, so can you not do it like:

<toolkit:VisualStateManager.VisualStateGroups>
    <toolkit:VisualStateGroup x:Name="LoginStates">
        <Windows:VisualState x:Name="LoggedOut">

I'm not too familiar with the consequences of using the extern alias method, so I don't know if that invalidates this at all.

Tim
  • 14,999
  • 1
  • 45
  • 68