WebBrowser control in an Accordion Control
i trying put webbrowser control within accordion control oob app nothing shows up. changed app not an oob app , ran code expecting see "html enabled out-of-browser mode" message no show either. is webbrowser control supported within accordion control. below code:
<toolkit:accordion verticalalignment="stretch" selectionmode="zeroorone" horizontalalignment="left" expanddirection="right" > <toolkit:accordionitem header="report" > <stackpanel width="300" > <webbrowser x:name="wb" /> </stackpanel> </toolkit:accordionitem> </toolkit:accordion>
private void textblock_mouseleftbuttondown(object sender, mousebuttoneventargs e) { var apn = ((textblock)sender).text; string features = "directories=no,location=no,menubar=no,status=no,toolbar=no, height=900, width=600,top=50,left=25";
wb.navigate(new uri(http://www.microsoft.com));
}
here way deal that
mainpage.xaml:
<usercontrol x:class="webbrowseroob.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" xmlns:local="clr-namespace:webbrowseroob" mc:ignorable="d" d:designheight="300" d:designwidth="400"> <usercontrol.resources> <local:browservisibilityconverter x:key="browservisibilityconverter" /> </usercontrol.resources> <grid x:name="layoutroot" background="white"> <toolkit:accordion verticalalignment="stretch" selectionmode="zeroorone" horizontalalignment="left" expanddirection="right" > <toolkit:accordionitem header="report" x:name="reportitem"> <stackpanel width="300" > <webbrowser x:name="wb" source="http://www.microsoft.com" width="300" height="600" visibility="{binding elementname=reportitem, path=isselected, converter={staticresource browservisibilityconverter}}" /> </stackpanel> </toolkit:accordionitem> </toolkit:accordion> </grid> </usercontrol>
mainpage.xaml.cs:
using system; using system.collections.generic; using system.linq; using system.net; using system.windows; using system.windows.controls; using system.windows.documents; using system.windows.input; using system.windows.media; using system.windows.media.animation; using system.windows.shapes; using system.windows.data; namespace webbrowseroob { public partial class mainpage : usercontrol { public mainpage() { initializecomponent(); } } public class browservisibilityconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { bool isselected = (bool)value; return isselected == true ? visibility.visible : visibility.collapsed; } public object convertback(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { throw new notimplementedexception(); } } }
i'd curious know if else has dealt behavior before too.
brice
Silverlight > Silverlight Controls and Silverlight Toolkit
Comments
Post a Comment