Is this a deliberate design decision, or just an omission? I tried using a
XamlDesigner to format the binding information, but OnSaveProperty() was not
called for the bound property. Apparently the binding causes the property to
be saved with compound property syntax, so OnSaveProperty() was not called.
I'm using the November CTP version of Avalon. Any insight would be much
appreciated.
Could you elaborate on what you're trying to do? Here's why I ask -- in
general, there is no right way for SaveAsXml to write out expressions and
events, because the information we need to serialize out was lost when the
document was loaded. (E.g., how do you serialize a delegate?) Fortunately,
the person calling SaveAsXml may know the right answer, so we have various
callbacks for that. So for example, if you're writing a visual designer you
store off certain information when the tree is created, and then use the
callbacks to help SaveAsXml serialize things how you want. But, doing that
is a nontrivial amount of work, and at present these callbacks are not real
well-documented, so I'd like to understand what you're doing before sending
you down this path. Thanks.
[1]
http://winfx.msdn.microsoft.com/winfx/ref/ns/system.windows.serialization/e/expressionserializationmode/expressionserializationmode.aspx
[2]
http://winfx.msdn.microsoft.com/winfx/ref/ns/system.windows.serialization/c/xamldesignerserializationmanager/xamldesignerserializationmanager.aspx
[3]
http://winfx.msdn.microsoft.com/winfx/ref/ns/system.windows.serialization/c/parser/m/saveasxml4.aspx
-Nick Kramer [MSFT]
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"MikeH" <Mi...@discussions.microsoft.com> wrote in message
news:82469EB8-B701-40B9...@microsoft.com...
Something slightly offtopic about SaveAsXml:
Why is SaveAsXml being called twice in all examples i see on the net?
Parser.SaveAsXml(main, xtw, xamldesigner);
Parser.SaveAsXml(main);
In my testing it made no difference if I removed the second call.
"Nick Kramer [MSFT]" <nkr...@ms.spam> wrote in message
news:O1e8tMLE...@TK2MSFTNGP10.phx.gbl...
public static void SaveAsXml(object, XamlDesignerSerializationManager);
public static void SaveAsXml(object, XmlWriter, XamlDesigner);
Whats the relation between XamlDesignerSerializationManager and
XamlDesigner?
This would mean that if I use the first overload I can't use a XamlDesigner?
"Nick Kramer [MSFT]" <nkr...@ms.spam> wrote in message
news:O1e8tMLE...@TK2MSFTNGP10.phx.gbl...
I'm working on a designer app that lets the user create data bound drawings
and forms. We don't need event handlers to be serialized, since we handle all
the events on behalf of the user. But we need to programmatically add/remove
binding information, and serialize/de-serialize it to/from XAML. Since the
binding information is stored in the tree (or at least accessible via
FrameworkObject.GetBinding()), this is pretty easy to do. Thanks again for
your help!
--
-Nick Kramer [MSFT]
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Vash" <vashist[at]wanadoo.nl> wrote in message
news:eHzMoQnE...@tk2msftngp13.phx.gbl...
[1] SaveAsXml(): When to use?
-Nick Kramer [MSFT]
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"MikeH" <Mi...@discussions.microsoft.com> wrote in message
news:239D897A-87D3-443A...@microsoft.com...
These two lines of code come straight from theWinFX SDK documentation ;)
>> Parser.SaveAsXml(main, xtw, xamldesigner);
>> Parser.SaveAsXml(main);
"Vash" <vashist[at]wanadoo.nl> wrote in message
news:O2EO%23knEF...@TK2MSFTNGP14.phx.gbl...
-Nick Kramer [MSFT]
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Vash" <vashist[at]wanadoo.nl> wrote in message
news:%23Rguumz...@tk2msftngp13.phx.gbl...