public static MultiSelectItemTemplateSelector GetMultiSelectItemTemplateSelector(MultiSelectTemplateDescriptor multiSelectTemplateDescriptor)
 {
     return(new MultiSelectItemTemplateSelector
     {
         SingleFieldTemplate = new DataTemplate
                               (
             () => new Grid
         {
             Style = LayoutHelpers.GetStaticStyleResource("MultiSelectItemStyle"),
             Children =
             {
                 new StackLayout
                 {
                     Margin = new Thickness(2),
                     Padding = new Thickness(7),
                     Children =
                     {
                         new Label
                         {
                             VerticalOptions = LayoutOptions.Center,
                             HorizontalOptions = LayoutOptions.Center,
                             FontAttributes = FontAttributes.Bold
                         }.AddBinding(Label.TextProperty, new Binding(multiSelectTemplateDescriptor.TextField))
                     }
                 }
                 .AssignDynamicResource(VisualElement.BackgroundColorProperty, "ResultListBackgroundColor")
             }
         }
                               )
     });
 }
 public MultiSelectReadOnlyObject(string name, List <string> keyFields, string title, string stringFormat, MultiSelectTemplateDescriptor multiSelectTemplate, IContextProvider contextProvider)
     : base(name, multiSelectTemplate.TemplateName, contextProvider.UiNotificationService)
 {
     this._multiSelectTemplate = multiSelectTemplate;
     this._keyFields           = keyFields;
     this._stringFormat        = stringFormat;
     this.httpService          = contextProvider.HttpService;
     this.Title       = title;
     this.Placeholder = this._multiSelectTemplate.LoadingIndicatorText;
     itemComparer     = new MultiSelectItemComparer <E>(this._keyFields);
     SelectedItems    = new ObservableCollection <object>();
     GetItemSource();
 }
Example #3
0
 public static MultiSelectItemTemplateSelector GetMultiSelectItemTemplateSelector(MultiSelectTemplateDescriptor multiSelectTemplateDescriptor)
 {
     return(new MultiSelectItemTemplateSelector
     {
         SingleFieldTemplate = new DataTemplate
                               (
             () => new Grid
         {
             Padding = new Thickness(10),
             Style = LayoutHelpers.GetStaticStyleResource("MultiSelectItemStyle"),
             Children =
             {
                 new Label
                 {
                     VerticalOptions = LayoutOptions.Center,
                     HorizontalOptions = LayoutOptions.Center,
                     FontAttributes = FontAttributes.Bold
                 }.AddBinding(Label.TextProperty, new Binding(multiSelectTemplateDescriptor.TextField))
             }
         }
                               )
     });
 }