When I Try to Create a Custom ViewCell I Get an Error?

DyaryDyary ✭✭Member ✭✭
edited August 2018 in Xamarin.Forms

Hi. I need to create a Custom VewCell so that i can reuse the code within it multiple times.
but i get these erros :

Error CS0234 The type or namespace name 'DateCell' does not exist in the namespace 'Xamarin.Forms' (are you missing an assembly reference?)

Error XLS0414 The type 'DateCell' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built

This is the code for the Xaml that i use :

            <?xml version="1.0" encoding="utf-8" ?>
            <DateCell 
                         x:Class="App31.DateCell"
                         xmlns="http://xamarin.com/schemas/2014/forms"
                         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                         >

                <StackLayout Orientation="Horizontal" Padding="14, 0">
                    <Label Text="Time" VerticalOptions="Center"/>
                    <TimePicker HorizontalOptions="EndAndExpand" />
                </StackLayout>

            </DateCell> 

and here is the code behind

                    using System;
                    using System.Collections.Generic;

                    using Xamarin.Forms;


                    namespace App31.Extensions
                    {

                        public partial class DateCell : ViewCell
                        {
                            public DateCell()
                            {
                                InitializeComponent();
                            }
                        }

                    }

How can I resolve this issue?
Thanks .

Best Answer

Answers

  • ClintStLaurentClintStLaurent ✭✭✭✭✭ USUniversity ✭✭✭✭✭

    @Dyary
    It would also help if you could fix up your post to include mardown so the site parser doesn't try to render the code you're including.
    https://redpillxamarin.com/2016/12/13/faq-frequently-asked-questions/

  • DyaryDyary ✭✭ Member ✭✭

    Thank you so much ClintB for your help , that resolved the problem.
    Also thanks to ClintStLaurent for the heads-up.

Sign In or Register to comment.