Jump to content
LaunchBox Community Forums

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.

Link to comment
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
Link to comment
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
Link to comment
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?

Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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!

Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...

Hi @Jason Carr and all code masters !!

On my (rare) free time, I'm working on some concepts for a new theme.

Currently, the navigation is on 3-fold:  PlatformView(s) > GamesView(s) > TextGameView.
I dont like the TextGameView too much. This forces to finish on only one design, even if we develop different design of GamesView.

So, I have a question:
Is it possible, in a GamesView  (wheel/Thum/Wall), to have 2 active mapped buttons ??

For exemple :
 - "A" = directly play the game.
 - "B" = launch option. (the TextGameView)
Not "start" button. Something more natural, like all UI.

 

And bonus question,
In  TextGameView, there is a way to replace each list item by a graphic ? (PNG, JPG ...) And use it like all BigBox wheel ? (clearLogo style)

 

I know, I ask a lot! ?
Thx !!!

Link to comment
Share on other sites

@viking Big Box has an option to skip the game details screen, so I'm guessing that's what you're going for. Unfortunately you can't force it on a theme though currently. But if you enable that option, then games will be played directly from the game lists.

Currently I don't know of a way to change the game details items into graphics (though XAML constantly surprises me with things that I didn't know exist). I do know that we need some more flexibility on that game details screen, but it's honestly probably a ways off yet.

  • Thanks 1
Link to comment
Share on other sites

Thank you @Jason Carr for these precisions. I suspected this answer!

I thought about another approach :

In one Vertical WheelGamesView for exemple, is it possible to have, in same time :

  • up/down arrow = show/move the clearLogo Wheel. 
  • left/right arrow = show/move alphabetical index for fast navigation.
  • "Select" mapped button in BB = show de "TextGameView option list". (not the GamesList)
  • "Play" mapped button in BB = Launch the game directly.

For me, the problem is that the "TextGameView Option List" is not a single block that can be called anywhere. It's linked only to the "basic game list".
The best the ability to call the "TextGameView Option List" as a solitary block. So, he must take hold of the up/down arrow.
If not, bind it to the VerticalWheel block, as it is linked to the GamesList block?

I imagine that all this is impossible. But I prefer to ask the question than to miss this opportunity.
Thank you !

Link to comment
Share on other sites

Non-skilled coder here needing some help. I have made a Startup theme that will play fullscreen video. Using MediaElement which I see from the thread is probably not the best, but figure since it is fullscreen only I should be ok. I can get the theme to work as intended to play the platform specific video by pulling the active game's platform. The problem is I cannot get a fallback to play a default video in cases where the user may not have a platform video. The code I am using I see used in BigBox themes, but I only get a black screen when the platform video is not present. Any advice?

    <!-- Video -->	
			<TextBlock x:Name="VideoFileName" Visibility="Collapsed">
				<TextBlock.Text>
					<MultiBinding StringFormat="{}pack://siteoforigin:,,,/StartupThemes/Video Full/Videos/{0}.mp4">
						<Binding Path="NonPlaylistNonCategoryPlatformTitle" />
					</MultiBinding>
				</TextBlock.Text>
			</TextBlock>
			<MediaElement Grid.RowSpan="5" Grid.ColumnSpan="5" Source="{Binding Text, ElementName=VideoFileName, FallbackValue='pack://siteoforigin:,,,/StartupThemes/Video Full/Videos/Startup.mp4'}" />		

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...