Activity's got a descr
This commit is contained in:
@ -61,5 +61,11 @@ namespace ZicMoove.Model.Workflow
|
||||
}
|
||||
|
||||
public CommandForm[] Forms { get; set; }
|
||||
|
||||
public string Description
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
66
ZicMoove/ZicMoove/Views/ActivityView.cs
Normal file
66
ZicMoove/ZicMoove/Views/ActivityView.cs
Normal 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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -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 };
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -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" />
|
||||
|
Reference in New Issue
Block a user