Activity's got a descr

This commit is contained in:
2017-02-07 17:01:42 +01:00
parent 57ad50a437
commit bdc3733f06
4 changed files with 73 additions and 40 deletions

View File

@ -61,5 +61,11 @@ namespace ZicMoove.Model.Workflow
}
public CommandForm[] Forms { get; set; }
public string Description
{
get;
set;
}
}
}

View File

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using Xamarin.Forms;
using ZicMoove.Model.Workflow;
namespace ZicMoove.Views
{
public class ActivityView : ContentView
{
public static readonly BindableProperty ContextProperty = BindableProperty.Create(
"Context",
typeof(Activity),
typeof(ActivityView)
);
public Activity Context
{
get
{
return BindingContext as Activity;
}
set
{
BindingContext = value;
}
}
public ActivityView()
{
}
public ActivityView(Activity context)
{
BindingContext = context;
}
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
var cnt = new StackLayout
{
};
cnt.Children.Add(new Label
{
Text = Context.Name,
Style = Resources["BigLabelStyle"] as Style
});
cnt.Children.Add(new Image
{
Source = Context.Photo,
HeightRequest = Device.OnPlatform<double>(40,40,40)
});
cnt.Children.Add(new Label
{
Text = Context.Description
});
}
}
}

View File

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using Xamarin.Forms;
using ZicMoove.Model.Workflow;
namespace ZicMoove.Views
{
public class CommandFormView : ContentView
{
public static readonly BindableProperty CommandType = BindableProperty.Create(
"Type",
typeof(string),
typeof(CommandFormView)
);
public string Type
{
get
{
return GetValue(CommandType) as string;
}
set {
SetValue(CommandType, value);
}
}
CommandForm Context { get { return BindingContext as CommandForm; } }
public CommandFormView()
{
Content = new Label { Text = Context?.Title };
}
}
}

View File

@ -129,7 +129,7 @@
<Compile Include="ViewModels\UserProfile\UserProfileViewModel.cs" />
<Compile Include="ViewModels\UserProfile\DirectoryInfoViewModel.cs" />
<Compile Include="ViewModels\Validation\ErrorSeverity.cs" />
<Compile Include="Views\CommandFormView.cs" />
<Compile Include="Views\ActivityView.cs" />
<Compile Include="Views\EnumPicker.cs" />
<Compile Include="Converters\BooleanToObjectConverter.cs" />
<Compile Include="Converters\EnumConverter.cs" />