diff --git a/ZicMoove/ZicMoove/Model/Workflow/Activity.cs b/ZicMoove/ZicMoove/Model/Workflow/Activity.cs index 61ce0918..8e03c620 100644 --- a/ZicMoove/ZicMoove/Model/Workflow/Activity.cs +++ b/ZicMoove/ZicMoove/Model/Workflow/Activity.cs @@ -61,5 +61,11 @@ namespace ZicMoove.Model.Workflow } public CommandForm[] Forms { get; set; } + + public string Description + { + get; + set; + } } } diff --git a/ZicMoove/ZicMoove/Views/ActivityView.cs b/ZicMoove/ZicMoove/Views/ActivityView.cs new file mode 100644 index 00000000..c29819dd --- /dev/null +++ b/ZicMoove/ZicMoove/Views/ActivityView.cs @@ -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(40,40,40) + }); + + cnt.Children.Add(new Label + { + Text = Context.Description + }); + } + } +} diff --git a/ZicMoove/ZicMoove/Views/CommandFormView.cs b/ZicMoove/ZicMoove/Views/CommandFormView.cs deleted file mode 100644 index 38fbdd24..00000000 --- a/ZicMoove/ZicMoove/Views/CommandFormView.cs +++ /dev/null @@ -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 }; - - } - } -} diff --git a/ZicMoove/ZicMoove/ZicMoove.csproj b/ZicMoove/ZicMoove/ZicMoove.csproj index 12ae5cb5..e8de8854 100644 --- a/ZicMoove/ZicMoove/ZicMoove.csproj +++ b/ZicMoove/ZicMoove/ZicMoove.csproj @@ -129,7 +129,7 @@ - +