473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 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 5452
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: RobinS | last post by:
I'm trying to learn WPF and do it in VB instead of C#. (God forbid I should do *anything* the easy way. ;-) Here's something weird. On p162-3 of this book by Petzold (in C# of course) in an...
0
by: walve_wei | last post by:
<1>use the D3D control panel, enable the debug DLL and maximum validation,for D3D control panel ,you need to install the directx sdk. <2>Start up the debug monitor (<MSVC install...
6
by: John | last post by:
Hi If I have a choice of WPF or Windows Form versions of a control which one should I purchase? Thanks Regards
11
by: Don | last post by:
I have a WPF application in VB in VSTS 2008 RTM. I am trying to "blink" (momentarily clear) a field of data if the data is reloaded from the database to give the user some visual indication of the...
23
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I...
2
by: Hans van Kruijssen | last post by:
We are using the windows forms webbrowser control in a WPF client application. Very rarely we get the following error message: Message Attempted to read or write protected memory. This is...
4
by: Roger Frost | last post by:
I need to draw a single point with WPF but there doesn't seem to be a class that represents the most fundamental geometric object. Any idea's? -- Roger Frost "Logic Is Syntax Independent"
2
by: Dean Slindee | last post by:
Is there any control in WPF which can host a WPF window? If not now, are there any plans to improve WPF to implement window hosting. Related question: is it not possible to build a MDI application...
0
by: Andy | last post by:
Hi, I'm trying to understand why something does work. If you create a new WPF Applicatin project, WpfApplication6, and set the following: MainWindow.xaml: <Window...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.