Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Set Binding.FallbackValue depending on DesignMode and RuntimeMode

 
 
Old 07-13-2007   #1 (permalink)
Horst Klein


 
 

Set Binding.FallbackValue depending on DesignMode and RuntimeMode

Hi I try to set a custom class to handle the FallbackValue depending on the
Design- and RuntimeMode.

The basic Idea:
We build Xaml to include in other Xamls.
For example an Adress.xaml that contains Name, Surname, City etc.
This Xaml we "recycle" (include) in other Xamls.
For examle into a Xaml to show patients, into a Xaml to show employers, and
so on
(all these "Persons" have an Adresse)

The DataContext is defined Outside in the "Root Xaml".
If we now want design the lowest Xaml (Adress.xaml) in Blend there is no
Datacontext defined.
To simulate datas we set the FallbackValue.

This works fine at designtime.
At runtime it works also.
But not if a datafield in the database contains a DbNull value.
In this case our "DesignTime" Value is shown.

In the attached VB sample I try to set the FallBackValue depending of the
Design- or RuntimeMode.

What I don't now is in what kind af way I have to set the return Value of my
"MyFallbackValueSource" Class
Override the ToString Function dons't help.

How can tell me how can return a value?
I my sample i return a String, can I also retrun numbers?

Thanks for support

Best regards
Horst










My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
How can I change a ConnectionString depending on the dev or prod environment ? .NET General
renaming files, depending on their dates ... PowerShell
2 separate addresses-can i select, depending on arena? Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46