WPF 3.5 SP1 App Model with Jennifer Lee
- Posted: May 16, 2008 at 12:51 AM
- 22,981 Views
- 23 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Still can't help but wonder why they just didn't call it "WPF 3.6" it would be allot more clearer for developpers, because some things just don't run on 3.5 , most things are not updates/bug fixes but new features.
I know this seems to be the Microsoft way, but in this video almost every sentence Jennifer says begins so it.
Normally I don't notice these kind of things, but it was really off putting for me!
Sorry to rant - interesting information, but the delivery just grated on me.
Agreed -- or even just drop the whole SP and call it .Net 3.51
As hard as it may be to covince developers that its "a service pack with features" convincing users is even harder.
BTW I like the agility of the wpf team to come out with three really solid (looking) releases in such a short time frame. I just think that there is no reason to conflate a service pack with a release.
Why can't you guys remember to post a link to the LOW-RES file on every video that you do?
It's very irritating when downloading with BITS to have to wait on 600Mb files.
---dup---dup---
Beavis has spoken!
I've heard its a northwestern thing.
Will the WPF WebBrowser control be a DependencyObject and therefore bindable? Could I, for example, do this:
<WebBrowser DocumentText="{Binding MyHtmlProperty}" />
??

ps. You're right about the "so", guys - both Adam and Jennifer started almost every sentence with it!
I'm taking this to mean you want to be able to bind an HTML string to some property on the WebBrowser and cause the WebBrowser to navigate when the data bound to the property is updated.
A few things here -
Yes, the WebBrowser control is a DependencyObject. However, we would have to expose navigating to an HTML string as a property (specifically, a DependencyProperty) for the databinding to work, and for it to work in XAML, which we do not. The functionality of navigating to an HTML string is achieved by calling the WebBrowser.NavigateToString() method. You will need to implement your scenario in code by calling the NavigateToString() method.
Therefore, the answer is NO, you could not do this:
<WebBrowser DocumentText="{Binding MyHtmlProperty}" />
I can see how the above would be useful and convenient. The change would mean you could 'get' the html string loaded as well as 'set' it (which is what the method achieves). We may look into adding it for a future release. As always, your feedback and specific affected scenarios certainly help in these matters, so please keep it coming!
Thanks!
Jennifer
For my purposes I would only need to set the HTML string (a "OneWay" binding) since the browser control itself wouldn't be doing any updating. Perhaps I could define an attached property or something that called NavigateToString() when it was set?
I think the old example you often see of a WPF app that reads RSS feeds would be well-served by a simple property on WebBrowser that lets you bind directly to a string - that way the browser could be bound to the selected item in the feed and simply display it as the user navigates through the list of items.
Matt
Yes, that sounds like the right thing to do. You might also try writing a custom control that has a child WebBrowser, if you want encapsulation.
We are working on putting together some WebBrowser samples, and I think the RSS scenario would be a good one, as well.
Thanks!
Jennifer
need more wpf controls~~ anyway, nice video~
This works when using the browser normally (sans the embedded WPF behavior)
-----------------------------------
· Open Internet Explorer
· Go to Tools > Internet Options
· Click the Advanced tab
· Scroll down to the Security options
· Check the option that reads:
Allow active content to run in files on My Computer
Does the new webbrowser sp1 can be inside visualbrush ?
http://forums.msdn.microsoft.com/en-US/wpf/thread/9e89a10d-8d39-4f36-945b-f8777a6ef422 ?
A poor man's workaround for this problem is to create a user control that wraps the WebBrowser and offers the needed dependency properties. Here is a quick example:
XAML Defenition (MyWebBrowser.xaml):
<UserControl x:Class="RSSTest.MyWebBrowser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="Auto" Width="Auto">
<WebBrowser Name="mWebBrowser">
</WebBrowser>
</UserControl>
C# code (MyWebBrowser.cs):
public partial class MyWebBrowser
{
public MyWebBrowser()
{
InitializeComponent();
}
public WebBrowser WebBrowser { get { return mWebBrowser; } }
public static readonly DependencyProperty StringHtmlProperty =
DependencyProperty.Register("StringHtml", typeof(string), typeof(MyWebBrowser),
new PropertyMetadata(new PropertyChangedCallback(OnStringHtmlChanged)));
public string StringHtml
{
get { return (string)GetValue(StringHtmlProperty); }
set { SetValue(StringHtmlProperty, value); }
}
private static void OnStringHtmlChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
MyWebBrowser me = (MyWebBrowser)d;
me.WebBrowser.NavigateToString(me.StringHtml);
}
public static readonly DependencyProperty UriProperty =
DependencyProperty.Register("Uri", typeof(Uri), typeof(MyWebBrowser),
new PropertyMetadata(new PropertyChangedCallback(OnUriChanged)));
public Uri Uri
{
get { return (Uri)GetValue(UriProperty); }
set { SetValue(UriProperty, value); }
}
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
MyWebBrowser me = (MyWebBrowser)d;
me.WebBrowser.Navigate(me.Uri);
}
}
Binding Examples:
<local:MyWebBrowser Uri="{Binding Path=Link}"/>
<local:MyWebBrowser StringHtml ="{Binding Path=HtmlString}"/>
<local:MyWebBrowser StringHtml="{Binding Path=Description, StringFormat={}<HTML><BODY\>\{0\}\<BODY\>\<HTML\>}"/>
Very nice sharing.thanks
<a href="http://www.medyum.info ">www.medyum.info</a></div>
nice share. thank you
Bedava dizi izle - http://www.dizikral.net
Thank you for sharing your article I would always follow.
<a href="http://www.askimchat.net" title="chat" target="_blank">chat siteleri</a>
Remove this comment
Remove this thread
close