wisemx

Member Since: Saturday, January 12, 2008 (4 years, 4 months ago)
Last Seen: 1 year, 8 months ago Who else is online?
Karma Score: 8074
Location: Johnson City, TN. U.S.A.
Website: http://msftwise.com

Friends With:

Friends By:

Shoutbox

wisemxwisemx(8074) said (2 years ago):
Hi guys...The new dotnetkicks is so groovy ;-)
pinaldavepinaldave(9662) said (2 years ago):
Thanks for coming back!
yesthatmcgurkyesthatmcgurk(4063) said (3 years, 4 months ago):
Hey, old timer. Don't bail just yet....
JemmJemm(9604) said (3 years, 10 months ago):
something
JemmJemm(9604) said (3 years, 11 months ago):
Great:) DNK has been in need of your quality posts :)
wisemxwisemx(8074) said (3 years, 11 months ago):
I did run away from all the spam but was drawn back by the sense of Community.
Rotten 1%ers spoil it for the nice guys. ;-)
JemmJemm(9604) said (3 years, 11 months ago):
W00t! You are back:)
wisemxwisemx(8074) said (4 years, 3 months ago):
Give this question a break until we get the updates during or just after Mix 08 ;-)
yesthatmcgurkyesthatmcgurk(4063) said (4 years, 3 months ago):
One more question...

Have you ever heard of embedding binary resources as string within XAML? I'd love to be able to have an image on a XAML document and have it serialized to a string resource inside the .xaml text. Managing resources in a separate file will be an issue for me in the future...
yesthatmcgurkyesthatmcgurk(4063) said (4 years, 3 months ago):
Thanks. I read over the article; it did give me some hints. I managed to get my xaml template -> XPS document code working. Get this...
For each DataRow
FixedPage xaml with layout and controls is loaded into a MemoryStream and fed to the XamlReader.
Data is bound to this template.
Template is configured for the page's resolution and size and its layout is updated.
A PageContent is created and the FixedPage template is set as its child
The PageContent is added to a FixedDocument.
When all data rows have been merged, an XpsDocumentWriter is created and the fixed document's DocumentPaginator is Write()'d.

Result: Xaml template + data -> XPS document.

Sweet.
wisemxwisemx(8074) said (4 years, 3 months ago):
I think just reading the default overview in the link below will be what you are looking for, especially the content/object properties for XAML:
http://msdn2.microsoft.com/en-us/library/ms752059.aspx
yesthatmcgurkyesthatmcgurk(4063) said (4 years, 3 months ago):
K, I'm busy too.
First question:

Coming from the windows forms/aspnet world, patterns for newing up forms and accessing controls aren't the same with XAML and WPF.
(everything I'm doing is currently in 2005) Lets say I have a DLL project. I add a new FlowDocument (WPF) to the project. This creates FlowDocument1.XAML. I open this up and see markup similar to an aspnet page. Great. I add a Paragraph and a TextBlock with Name="Lol" to the FlowDocument node in the XAML editor. I add the attribute Name="MyFlowDocument" to the root FlowDocument node. The XAML document does not have a codebehind file, nor does it have inline code.

Now, what I want to do is "new" up the object described by this XAML document: FlowDocument fd = new MyFlowDocument() and I want to access the TextBlock: fd.Lol.Text = "Hai from WPF!"

This, of course, does not work. How do I manipulate XAML documents like this in code? Bonus question: how could I do this generically--for any WPF document (FrameworkElement?), if it has a TextBlock with a name of "Lol", set the text to equal the above?
TIA.
wisemxwisemx(8074) said (4 years, 3 months ago):
I like the idea of hashing it here, makes it public and I'm all for community.
Sorry it took me a day to get back, was away.
yesthatmcgurkyesthatmcgurk(4063) said (4 years, 3 months ago):
Hai, thanks for the offer to help.
So, this xaml thing... I have a number of questions that I'm having a hard time wrapping my head around, but the shoutbox here is kinda small. What do you think?

Kick Spy