471,310 Members | 1,026 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

WPF: ObjectDataProvider and the System.Windows.TextAlignment Enum


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
1 5301
"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.

Similar topics

6 posts views Thread by John | last post: by
23 posts views Thread by raylopez99 | last post: by
2 posts views Thread by Hans van Kruijssen | last post: by
4 posts views Thread by Roger Frost | last post: by
2 posts views Thread by Dean Slindee | last post: by
reply views Thread by Andy | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.