By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,458 Members | 1,463 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,458 IT Pros & Developers. It's quick & easy.

WPF: ObjectDataProvider and the System.Windows.TextAlignment Enum

P: n/a

I need to use an ObjectDataProvider in a resource file to pull in the
System.Window.TextAlignment enum which is part of the PresentationCore.DLL.

I was able to do this with the HorizontalAlignment enum which uses the
PresentationCore.DLL like this:
xmlns:sysWin="clr-namespace:System.Windows;assembly=PresentationFram ework"

<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}"
x:Key="resHorizontalAlignment">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="sysWin:HorizontalAlignment"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

But for 'TextAlignment ', this does NOT work:

xmlns:sysWinCore="clr-namespace:System.Windows.Interop;assembly=Presenta tionCore"

<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}"
x:Key="resTextAlignment">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="sysWinCore:TextAlignment"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

I get the compile error:
Error 101 Type 'TextAlignment' was not found.

Any advice:

Thanks

--
mo*******@newsgroup.nospam
Jul 14 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"moondaddy" <mo*******@newsgroup.nospamwrote in message
news:O8**************@TK2MSFTNGP02.phx.gbl...
>I need to use an ObjectDataProvider in a resource file to pull in the
System.Window.TextAlignment enum which is part of the PresentationCore.DLL.

I was able to do this with the HorizontalAlignment enum which uses the
PresentationCore.DLL like this:
xmlns:sysWin="clr-namespace:System.Windows;assembly=PresentationFram ework"

<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}"
x:Key="resHorizontalAlignment">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="sysWin:HorizontalAlignment"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

But for 'TextAlignment ', this does NOT work:

xmlns:sysWinCore="clr-namespace:System.Windows.Interop;assembly=Presenta tionCore"

<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}"
x:Key="resTextAlignment">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="sysWinCore:TextAlignment"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

I get the compile error:
Error 101 Type 'TextAlignment' was not found.

Any advice:
Try
xmlns:sysWinCore="clr-namespace:System.Windows;assembly=PresentationCore "
(I think it's the ".Interop" in your version that's causing the problem).

Chris Jobson
Jul 14 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.