I am trying to show a url from Sketchfab and I can´t get the desired results. I need to show a page like this.
https://sketchfab.com/models/dGUrytaktlDeNudCEGKk31oTJY/embed?autospin=0.3&autostart=1&ui_infos=0
If you go there you can see that the model starts to spin automatically but if I put this Url in the source property of my WebBrowser control it shows the model but I doesn´t spin. The code that I am using is this:
<phone:PanoramaItem Header="{Binding Source={StaticResource LocalizedStrings}, Path=LocalizedResources.MainPagePanoramaItemViewTitle}" Orientation="Horizontal">
<Grid>
<phone:WebBrowser x:Name="WebBrowserViewer" Background="Black" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="450"
Source="https://sketchfab.com/models/dGUrytaktlDeNudCEGKk31oTJY/embed?autospin=0.3&autostart=1&ui_infos=0"
IsScriptEnabled="True" HorizontalContentAlignment="Stretch"/>
</Grid>
</phone:PanoramaItem>
Is posible reproduce this "autospin" and adjust de viewer to the WebBrowser control ?
Thanks a lot
Related
i need a little hand on this please,
Context : Windows 10 UWP Development, C#, Visual Studio 2017
I don't understand why I can pass INotify properties in my code, but i can not in the GEDContenuPage page view, that I want to add in the left pane of my SplitView.
<SplitView Grid.Row="1"
IsPaneOpen="{Binding IsGEDOpen}"
DisplayMode="Inline"
OpenPaneLength="{Binding GEDPaneWidth}">
<SplitView.Pane>
<Grid>
<v:GEDContenuPage Visibility="{Binding IsGEDOpen, Converter={StaticResource BoolToVisibilityConverter}}" />
</Grid>
</SplitView.Pane>
<ScrollViewer >
<Grid x:Name="mainGridData" />
</ScrollViewer>
</SplitView>
IsPaneOpen="{Binding IsGEDOpen}" will works and do its job (open or close left pane)
BoolToVisibilityConverter is in app.xaml and works well (tested somewhere else)
I have also created a DependencyPropertyin my page control :
<v:GEDContenuPage
Visibility="{Binding IsGEDOpen, Converter={StaticResource BoolToVisibilityConverter}}"
ext:GEDContenuPageExtension.ContenuId="2446"
/>
Same thing here, 2446 will works well, This will open my left pane with the right content.
But I i try to replace it with a Binding :
ext:GEDContenuPageExtension.ContenuId="{Binding GedContenuId}
It won't work.
I guess this is end of the week, and the only thing I need is a fresh beer to put things right in my mind...
For your information, the left pane will receive other page than GEDContenuPage. This is why I need a visibility property for each page.
Thanks for help,
OK this was a datacontext issue, this done the trick
<Grid Name="parentGrid">
<v:GEDContenuPage Visibility="{Binding DataContext.IsGEDOpen, Converter={StaticResource BoolToVisibilityConverter}, ElementName=parentGrid}" />
I'm facing some issues with displaying data on a listview in my WindowsApp 8.1 mobile. There is a table in my Azure Mobile Service called SugarControler which is the same name for a class that handles the data. which stores some data and has a column called "Level". When I'm trying to display data from that column in my app, I don't get data from that column, but instead every record displayed in the ListView is MyApp.Controlers.SugarControler. What am I missing here?
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
...
<ListView Name="ListItems" Margin="0,9.5,-0.167,10" Grid.Row="4">
<ListView.Resources>
<DataTemplate x:Name="cell">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Level}"/>
</StackPanel>
</DataTemplate>
</ListView.Resources>
</ListView>
</Grid>
From the backend site everything seems to be ok, as I can add a new data into the database from the UI and it is displayed properly in the Azure database.
I cannot find any information about how to structure the hubControl a little bit better. All the examples I can find put all the information in one xaml file. Am I missing something? I don't think that this gives you an easily maintainable code. The hub template creates the following code (stopping after the first section to abbreviate but there are four more to come in the sample code):
<Grid x:Name="LayoutRoot">
<Hub x:Name="Hub" x:Uid="Hub" Header="application name" Background="{ThemeResource HubBackgroundImageBrush}">
<HubSection x:Uid="HubSection1" Header="SECTION 1" DataContext="{Binding Groups}" HeaderTemplate="{ThemeResource HubSectionHeaderTemplate}">
<DataTemplate>
<ListView
ItemsSource="{Binding}"
IsItemClickEnabled="True"
ItemClick="GroupSection_ItemClick"
ContinuumNavigationTransitionInfo.ExitElementContainer="True">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,27.5">
<TextBlock Text="{Binding Title}" Style="{ThemeResource ListViewItemTextBlockStyle}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DataTemplate>
</HubSection>
How is it possible to have each section in a different xaml file?
Or are there other ways to get a better code structure?
I did something like this with the pivot control by adding the pivot items in code but the hub control does not have a content property and messing around with content templates seems a little bit too ugly. Does anyone have an idea? Thanks in advance.
Although I am still struggeling with passing the data context/ viewModel in some cases I guess the simple solution is to just create a new file (user control or page) and use something like
<HubSection Header="About">
<DataTemplate>
<local:AboutPage />
</DataTemplate>
</HubSection>
Thanks to everybody who had a look!
I think what you're looking for is a DataTemplateSelector. This allows you to write a custom mapping from instance to template in code.
I have this XAML code block:
<StackPanel Orientation="Horizontal">
<TextBlock Text="Hello " />
<TextBlock Text="World" />
</StackPanel>
I would like to define this block (for example in /Common/CustomStyles.xaml) to include it on different XAML pages. How does it work?
I do not need a DataTemplate or something similar because the text is static.
You could put it in a user control and re-use it that way. If it's just the text you are interested in then you could use a resource file - this would update the textbox on any screen as long as it had the right uid.
Has anyone solved this: displaying graphical resources within a button
create a resource, for instance a rectangle
<UserControl.Resources>
<Rectangle x:Key="myRectangle" Fill="Red" Height="100" Width="100"/>
</UserControl.Resources>
then set the content of the button to the resource
<Button Content="{StaticResource myRectangle}"/>
when you build inside blend 4 RC you get the error "Value does not fall within the expected range."
Visual studio does not show this error.
When you run the site the button doesn't show any content.
This technique works in WPF without problems.
Anyone got any ideas?
This can be done by directly setting the shape as the button's content. For eg:
<Button Height="120" Width="120">
<Rectangle Fill="Red" Height="100" Width="100"/>
</Button>
FrameworkElement.Resources are generally used for storing nonvisual elements, brushes, etc. For your case (I think) you'll need to store your xaml as a data template, again not sure if this works with Buttons, it is used for things like ListBoxes. See here:
resources description on msdn. The link further contains pointers to information for Data Templates etc.