Dear all,
Now I'm using the great BladeView control in my app. 馃憤
The question is, I was trying to bind like this:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<controls:BladeView Margin="4"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ItemTemplate="{StaticResource RepoBladeItemTemplate}"
ItemsSource="{x:Bind RepoBladeViewModel.Blades, Mode=OneWay}"
>
In my ViewModel:
public ObservableCollection<RepoBladeItemModel> Blades { get; }
This does work, so I can have arbitrary levels of Blades showing, the problem is, it does NOT scroll to the most recent blade added? I see in the toolkit example it does scroll. So anything I can/should do for this?
Another question regarding state: suppose I have expanded the blade to many levels and app got suspended, what shall I do to recover all these levels when app is back to life?
Thanks a lot for the helping,
Dong
There must be some kind of a property changed call missing when you add a new blade to the collection. This is why it is not scrolling to the latest blade. I will check for it.
Your RepoBladeItemModel must be serializable. If you are using Prism, there's a service called SessionStateService which handles suspension scenarios like you mentioned above if you registered them as known type. Service will store your blade model information and restores them when the user gets back to the app. If you are not using Prism, I highly recommend using it :) Otherwise you should write some kind of a helper that will serialize your models and restores them back.
You should check on this Application Lifecycle guide on MSDN. Whenever users get back to your app, OnNavigatedTo method is called. You should also consider that. And if you are using Prism, remember since .NET Native introduced you must register your Types to the Default.rd file in order to app to known which models can be serializable or not.
@xied75 Are the items being added to the blade view but just not scrolling? Does it go to the added item or do you have to scroll to it?
@skendrot New blades created fine, just not scrolling, I need to manually do that. Thanks for helping
@xied75 On what device(s) ?
A touch enabled ThinkPad X1 Carbon and a 12 inch Atom Tablet.
Looks like there are a few issues with binding to a collection. I'm looking into it
ping. Any chance this could be fixed for 1.4?
@xied75 Yes, it will be fixed for 1.4 馃槃 , but thanks for the bump as a reminder!
up?:)
last call for 1.4
Not gonna make it. Sorry :(
@skendrot If you can point me where to look I'll give it a try, otherwise I will be releasing my app with the current BladeView, which is quite important in my app. :(
@xied75 since BladeView is now deprecated, check out the OnBladesChanged static method in the BladeControl.cs. Try to get the _scrollViewer and scroll it to the end when new Blade is added.
I am not sure it'll work though since I can't check the code for now. In theory it should work (like anything we think in life :P)
@bkaankose BladeView is the new one, Blade is deprecated.
@xied75 As a quick hack to fix your issue you could do the following:
Another workaround: