Jump to content
LaunchBox Community Forums
Jason Carr

XAML Tips and Tricks

Recommended Posts

5 minutes ago, Klopjero said:

I have a question. is it possible to embed a view in another view ? or call the data that is handled by that view? 

I'd like to list most recent achievements in the game details box, j

I'm 99% sure its not possible to embed a view in another view or call the data by that view... but I'm sure someone who knows better can say otherwise.

Share this post


Link to post
Share on other sites
8 hours ago, Klopjero said:

I have a question. is it possible to embed a view in another view ? or call the data that is handled by that view? 

I'd like to list most recent achievements in the game details box, j

You can embed another view, but unfortunately, as the view model in the code (my code) doesn't have a property for the achievements view model, it wouldn't be bound to any data, so it wouldn't be useful. I would just have to add a property to the games views to allow it. It might need some tweaking on my part though because it currently shows all the achievements.

  • Like 1

Share this post


Link to post
Share on other sites
27 minutes ago, Jason Carr said:

You can embed another view, but unfortunately, as the view model in the code (my code) doesn't have a property for the achievements view model, it wouldn't be bound to any data, so it wouldn't be useful. I would just have to add a property to the games views to allow it. It might need some tweaking on my part though because it currently shows all the achievements.

Cool... :) thanks for replying. 

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

Does anyone know if it's possible to delay a game video from starting when a game is selected in wheelgamesview? I know about selected vs. active. But could you have it wait another second?

I'm asking for a theme I'm making.

Thanks

Share this post


Link to post
Share on other sites
On 2/9/2019 at 1:55 PM, bbweiners said:

Hi,

Does anyone know if it's possible to delay a game video from starting when a game is selected in wheelgamesview? I know about selected vs. active. But could you have it wait another second?

I'm asking for a theme I'm making.

Thanks

I honestly don't know, but I'm thinking it might be done by some other themes. Maybe Grila's ComixBox for instance?

Share this post


Link to post
Share on other sites
On 2/9/2019 at 4:55 PM, bbweiners said:

Hi,

Does anyone know if it's possible to delay a game video from starting when a game is selected in wheelgamesview? I know about selected vs. active. But could you have it wait another second?

I'm asking for a theme I'm making.

Thanks

You could try to set the video's visibility to collapsed, and then animate it to visible after a certain number of seconds.

Share this post


Link to post
Share on other sites
4 minutes ago, faeran said:

You could try to set the video's visibility to collapsed, and then animate it to visible after a certain number of seconds.

That's a good idea. But I'm trying to prevent it from loading at all for an extra second or so, so that people that are navigating through games on slower computers won't be slowed down with videos trying to load quite as often.

Does that make sense?

Edited by bbweiners

Share this post


Link to post
Share on other sites
36 minutes ago, bbweiners said:

That's a good idea. But I'm trying to prevent it from loading at all for an extra second or so, so that people that are navigating through games on slower computers won't be slowed down with videos trying to load quite as often.

Does that make sense?

Yes. I asked myself the same question when I was developing retrotastic, but in the end couldn't find a solution to delaying the loading of a video. Someone would have to develop a custom plugin for that, or it would need to be built into Bigbox.

I did read somewhere that using collapsed visibility makes it so it doesn't render the control, but I have no idea whether that would translate to better performance.

Share this post


Link to post
Share on other sites
4 minutes ago, faeran said:

Yes. I asked myself the same question when I was developing retrotastic, but in the end couldn't find a solution to delaying the loading of a video. Someone would have to develop a custom plugin for that, or it would need to be built into Bigbox.

I did read somewhere that using collapsed visibility makes it so it doesn't render the control, but I have no idea whether that would translate to better performance.

That's good info @faeran. Thanks for the response. I'll try your suggestion. Maybe that will help/work. At least now I know to stop chasing something that doesn't exist. Thanks!

Share this post


Link to post
Share on other sites

@Jason Carr In the TextListView XAML, how do I change the Logo image displayed to show the Platform's Clear Logo rather than the selected game's Clear Logo? Is it possible or is it not due to a scope restriction  (Platform vs. Game)?

<DockPanel Name="RootPanel" Visibility="{Binding ListVisibility}">
        <Image Name="Logo" DockPanel.Dock="Top" Visibility="{Binding LogoVisibility}" RenderOptions.BitmapScalingMode="HighQuality" />

I do not maintain individual game clear logos. I'd like to be able to show a consistent platform logo in its intended space.

Edited by throwingmuse

Share this post


Link to post
Share on other sites
On 2/14/2019 at 7:54 AM, throwingmuse said:

@Jason Carr In the TextListView XAML, how do I change the Logo image displayed to show the Platform's Clear Logo rather than the selected game's Clear Logo? Is it possible or is it not due to a scope restriction  (Platform vs. Game)?


<DockPanel Name="RootPanel" Visibility="{Binding ListVisibility}">
        <Image Name="Logo" DockPanel.Dock="Top" Visibility="{Binding LogoVisibility}" RenderOptions.BitmapScalingMode="HighQuality" />

I do not maintain individual game clear logos. I'd like to be able to show a consistent platform logo in its intended space.

I think you should be able to remove the Name="Logo" part and add Source="{Binding Platform.ClearLogoImagePath}" instead.

Share this post


Link to post
Share on other sites
1 hour ago, Jason Carr said:

I think you should be able to remove the Name="Logo" part and add Source="{Binding Platform.ClearLogoImagePath}" instead.

@Jason Carr I attempted that plus a few other variations.

The binding below works if I want to place a Platform Logo elsewhere in the view using an <Image> tag. However, it does not work in the List Dock:

Source="{Binding Path=ActiveGame.PlatformClearLogoImagePath}"

My issue is with the navigation List Dock.

  • My theme uses three views: PlatformWheel2FiltersViewTextGamesView, and TextListView for the navigation list.
  • My theme is derived from the theme Fundamental.
  • PlatformWheel2FiltersView displays Platform Logos in the wheel selection.
  • TextGamesView displays the Platform Logo of the selected platform when Name="Logo" is used in TextListView .
  • TextListView will display a Game Logo of the selected game when Name="Logo" is used in TextListView.
  • TextGamesView nor TextListView display any logo when Name="Logo" is not used in TextListView.

Is there a possible scope restriction in TextListView which only considers media for the Selected Game? Is there some other dependency I am missing, perhaps?

Edited by throwingmuse

Share this post


Link to post
Share on other sites

@throwingmuse I think the issue is probably that the TextListView doesn't have access to the Platform property (only the parent games views do). You might be able to bind to the parent element's data context, though, from the TextListView. I'm honestly not sure if that's possible, but I know you can do it elsewhere (like in a grid), just not sure about doing it across the different controls.

The other option would be to put the image actually in the parent games view, and just overlap or resize the list view. That's probably what I would recommend.

Share this post


Link to post
Share on other sites
19 hours ago, Jason Carr said:

@throwingmuse I think the issue is probably that the TextListView doesn't have access to the Platform property (only the parent games views do). You might be able to bind to the parent element's data context, though, from the TextListView. I'm honestly not sure if that's possible, but I know you can do it elsewhere (like in a grid), just not sure about doing it across the different controls.

The other option would be to put the image actually in the parent games view, and just overlap or resize the list view. That's probably what I would recommend.

That's what I ended up doing. I removed the embedded Image from the List Dock and simply put a sub-Grid on the parent page to hold an image on top (PlatformLogo) and the List on the bottom.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×