ApplicationInfo appInfo = app as ApplicationInfo;
if (appInfo != null)
{
+ TaskManagerLogger.Debug($"Resuming '{appInfo.Name}' app");
try
{
appInfo.Controller.Resume();
ApplicationInfo appInfo = app as ApplicationInfo;
if (appInfo != null)
{
+ TaskManagerLogger.Debug($"Killing '{appInfo.Name}' app");
try
{
appInfo.Controller.Dismiss();
private void KillAllApplications()
{
+ TaskManagerLogger.Debug("");
foreach (var app in this.Applications)
{
try
public static readonly BindableProperty ScrollerProperty = BindableProperty.Create(nameof(Scroller), typeof(ScrollView), typeof(ContentView), null, BindingMode.TwoWay, null);
public ScrollView Scroller
{
- set
- {
- SetValue(ScrollerProperty, value);
- }
- get
- {
- return (ScrollView)GetValue(ScrollerProperty);
- }
+ set { SetValue(ScrollerProperty, value); }
+ get { return (ScrollView)GetValue(ScrollerProperty); }
+ }
+
+ public static readonly BindableProperty OnIconTappedProperty = BindableProperty.Create(nameof(OnIconTapped),
+ typeof(ICommand), typeof(ContentView), null, BindingMode.OneWay, null);
+
+ public ICommand OnIconTapped
+ {
+ set { SetValue(OnIconTappedProperty, value); }
+ get { return (ICommand)GetValue(OnIconTappedProperty); }
+ }
+
+
+ public static readonly BindableProperty OnIconDismissedProperty = BindableProperty.Create(nameof(OnIconDismissed),
+ typeof(ICommand), typeof(ContentView), null, BindingMode.OneWay, null);
+
+ public ICommand OnIconDismissed
+ {
+ set { SetValue(OnIconDismissedProperty, value); }
+ get { return (ICommand)GetValue(OnIconDismissedProperty); }
}
public AppItemView()
private void OnTapped(object sender, EventArgs e)
{
- var appInfo = BindingContext as ApplicationInfo;
- appInfo?.Controller.Resume();
+ OnIconTapped?.Execute(BindingContext);
}
private async void OnPanUpdated(object sender, PanUpdatedEventArgs e)
private void DismissApp()
{
- var appInfo = BindingContext as ApplicationInfo;
- appInfo?.Controller.Dismiss();
+ OnIconDismissed?.Execute(BindingContext);
}
private void Collapse()
using System.Windows.Input;
using Tizen;
using Xamarin.Forms;
+using TaskManager.Tizen.Utils;
namespace TaskManager.Tizen.Views
{
private void OnTapped(object sender, EventArgs e)
{
- Log.Debug("TSK_MGR", "Clear all item tapped");
- if (OnIconTapped == null)
- {
- return;
- }
+ TaskManagerLogger.Debug("Clear all item tapped");
OnIconTapped?.Execute(sender);
}
}
xmlns:views="clr-namespace:TaskManager.Tizen.Views;assembly=TaskManager.Tizen"
xmlns:controls="clr-namespace:TaskManager.Tizen.Controls;assembly=TaskManager.Tizen"
x:Class="TaskManager.Tizen.Views.MainView"
+ x:Name="root"
ContentVisible="{Binding Applications, Converter={StaticResource ListToBoolConverter}}"
>
<views:BindableStackLayout.ItemTemplate>
<DataTemplate>
<ViewCell>
- <views:AppItemView Scroller="{x:Reference scroller}"/>
+ <views:AppItemView Scroller="{x:Reference scroller}" OnIconTapped="{Binding BindingContext.ResumeApp, Source={x:Reference Name=root}}" OnIconDismissed="{Binding BindingContext.KillApp, Source={x:Reference Name=root}}"/>
</ViewCell>
</DataTemplate>
</views:BindableStackLayout.ItemTemplate>