Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 89864 articles
Browse latest View live

Is it possible to pre-render a ContentPage? How to avoid lag when navigating to heavy Xaml pages?

$
0
0

Hey guys,

When navigating to some of my ContentPages, there's some lag from when the navigation button is clicked, to when the ContentPage shows. This is not caused by data loading or anything of that sort. It's purely caused by heavy Xaml.

I'm wondering if it's possible to pre-render these ContentPages to allow for instant navigation without lag? If not, then how would I deal with navigating to heavy Xaml pages without any lag?


OnAppearing event does not fire when a ContentPage pushed via Navigation.PushAsync

$
0
0

Hi,

I have a ContentPage being rendered by calling Navigation.PushAsync. The OnAppearing event is not firing when the AddLocationPage is loaded/rendered.

Any assistance would be appreciated! I've been sitting with this for the last two days.

public partial class App : Xamarin.Forms.Application
{
    public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new MainTabbedPage()); // MainTabbedPage : Xamarin.Forms.TabbedPage 
        }
}
-- This ContentPage sits within a Xamarin.Forms.TabbedPage as the first TabbedPage.Children <mainTabs:LocationsPage />
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LocationsPage : ContentPage
{
    public LocationsPage()
    {
        InitializeComponent();
        NavigationPage.SetHasNavigationBar(this, false);
    }

    private async void OnListItemSelected(object sender, SelectedItemChangedEventArgs e)
    {
        if (e.SelectedItem != null)
        {
            await Navigation.PushAsync(new AddLocationPage
            {
                BindingContext = e.SelectedItem as LocationDbModel
            });
        }   
    }
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AddLocationPage : ContentPage
{
    public AddLocationPage()
    {
        InitializeComponent();
        NavigationPage.SetHasNavigationBar(this, false);
    }

    // ISSUE: OnAppearing event not being called
    // This page gets invoked/pushed using Navigation.PushAsync from LocationsPage.OnListItemSelected()
    protected override void OnAppearing()
    {
        base.OnAppearing();

        var binddingContextData= (LocationDbModel)BindingContext;

         if ((binddingContextData == null || binddingContextData.Latitude == 0) && binddingContextData.Longitude == 0)
            return;

        // removed for brevity - This code needs to be executed when the page is loaded.
    }
}

CollectionView - Horiztonal - Full Width

$
0
0

I am trying to do a Collection View , Horizontal with each cell the full width of the screen.
I have to set the width the of the view within the data template as simply doing a "FillAndExpand" makes it wider than the screen.
So the question is how can I know the width of the screen to set this ?

Sendin a Object and getting List From Rest Api

$
0
0

i want to get i list from rest api by sendin parameters (as pbject), Ex.) i have a student table, i want to send an object that list should be specified and gettin list.. suppose that i ll send gander=male.. age=15 cource=math.. i ll send this and i want to get list and bind.

UWP UI Colors (Tool Bar and Tabbed Page)

$
0
0

Hello,
I feel bad that my first post here will probably be stupidly simple but I can’t seem to find this one, so after a full day of looking around I decided to ask (and accept all criticism). Created a UWP application inside an already existing (Prism) Forms project, everything referenced to the Forms nicely, but editing the colors is not straightforward at all.
Specifically the Tool Bar (or Navigation Bar?, the red square) has this gray-ish color (from the Light Theme I presume) and I can’t seem to change it or the letters. Was looking around for a non hackish solution like changing the theme’s light color, even though I haven’t tried that to even see if it works. Also the “More” dot thing (the blue circle), is redundant, there is nothing to expand, can it go away?
Lastly in the tabbed page, the icons (purple square) are stacked on the left side and I cannot seem to find anything resembling its Column Definitions, Horizontal Options or the option of whatever structure it uses to align them in the center. Do I need a custom renderer for this one?
I have no code to show, since I don’t even know from where to edit these, the Xamarin docs had an example with SolidColorBrush for buttons but since most code I found uses x:Keys to reference the items, I don’t have intellisense on those and can’t try different things out.

Thanks for any answer on any on the above in advance!

My Android google api client app faults on the initial GDConnect method.

$
0
0

1.The app is a vs2019 xamarin forms xaml cross platform uwp app.
2.I have a google account for folder/file access to mydrive.
3.I created a client_services.json config to allow me to connect and placed that
file in my vs2019 android project root folder.
4.Code that faults is in a shared library which is called by the android main activity code
5.The shared library code is attached.

it fails at run time when my gdhelpger.cs google code issues the gdconnect method.
that method throws this exception: System.IO.FileNotFoundException:
'Could not find file 'C:\AppDev\Xamarin\DIYApps\DIYLvad\DIYLvad\DIYLvad.UWP\bin\x86\Debug\AppX\client_secrets.json'.'

Slider with custom image

$
0
0

I'm trying to change the Thumb of the Slider but I don't seem to be able to do so. I've created a custom Slider class. The code is below. It loads the image from file correctly but when I added as the ThumbImageSource nothing happens. It does turn 'blue' so that part does work.

using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;

namespace ElectroSpit.Controls
{
    public class RockerSlider : Slider
    {
        public RockerSlider()
        {
        }

        protected override void OnSizeAllocated(double width, double height)
        {
            base.OnSizeAllocated(width, height);

            var image = ImageSource.FromFile("Assets/Thumb.jpg");
            this.ThumbColor = Color.Blue;
            this.ThumbImageSource = image;
        }
    }
}

Using the WebAuthenticator with the Sample.Server.WebAuthenticator?

$
0
0

Using the setup from the WebAuthenticator sample and guide, is it possible to use the [Authorize] attribute on a WebApi Controller to prevent anomymous access?

Guide
https://docs.microsoft.com/en-us/xamarin/essentials/web-authenticator?context=xamarin/android&amp;tabs=android

Server sample
https://github.com/xamarin/Essentials/tree/develop/Samples/Sample.Server.WebAuthenticator

  • Would I need other configuration server side, besides adding a controller i want to acces and use the [Authorize] attribute?
  • Is the token from Web Authenticator a bearer token? Is it enough in theory to add it to the HttpClient's headers as a bearer?

How to set background image for the navigation drawer

$
0
0

How to set background image for the navigation drawer working with masterdetailpage

Complete Docker container as Mobile Backend?

$
0
0

Is it possible or anyone is working with docker as a mobile backend api? My idea is to host sql server+web api core together in docker container instead of azure web apps and azure sql server. By that i target to gain all docker pros and it should be cheaper to host it. Any idea or experience?

how to change the entry curser color from pink to manually define in android

$
0
0

hello all,
i want to change the by default entry curser pink color to manually defined color as the app themes in android and ios.
and thanks in advance

ToolbarItems are displayed twice

$
0
0

hi,
when i exceute my single page of application then toolbar items are properly displayed ,but when i navigate the page then double icon are displayed .

code for toolbar item added in xaml file

App.xaml.cs in which i called the respective page

plz give me suggestion to how to solve this..

How to use Done in picker

$
0
0

How do i use the Done button in a picker .

Am loading some text from a database using a picker , after selecting an item it is going to do download the text.

But i want to use the "Done" button and not SelectedIndexChanged="picker_SelectedIndexChanged"

Problems implementing Camera Preview

Collection and ViewStateManager

$
0
0

I have a page with a atcklayout that contains a collectionviewand followed by another stacklayout. I have followed this

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/selection#change-selected-item-color

to change the selection backgroundcolor but it changes the backgroundcolor of the stacklayouot as well. I guess the stacklayouts "state" is "normal" so it uses the normal state color. That is because you define the VSM relative to the root element on the page. Targetting the second stacklayout doesn;t wrk either. any suggestions?


Can't play MP4 video in Android

$
0
0

Hi. I am trying to play a video in my application.

I placed my video "Dice65.mpg" in Android /Resources/raw directory.

My Xaml looks like this: (used brackets because the forum code kept hiding stacklayout and media element.
<ContentPage.Content>
[StackLayout]
[MediaElement x:Name="VideoPlayer" ShowsPlaybackControls="False" /]
[/StackLayout]
</ContentPage.Content>

My Xaml.cs looks like this:
public DiceRoll()
{
InitializeComponent();
VideoPlayer.Source = "ms-appx:///Dice65.mp4";
}

I get this error:
System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'

The documentation didn't seem to imply that anything else was needed. Am I missing something?

Thank you.

CollectionView background color not highting when add the items to the list

$
0
0

Hi, i am using collectionview for selecting multile items. when select the items, background color is coming.but my problem is when add the items to the list , now not getting the background color for iOS . working fine in android .i used in two ways but no luck.

  1. in ViewMode
    var items= ListOfScanTest.Where(x => x.ScanTestsName == SendAppointmentData.Rscantest).ToList();
    SelectedListOfScanTest = items;

  2. in .cs
    collectionList.SelectedItems = SelectedListOfScanTest .Cast < object > ().ToList();

in XAML

please any one help me out from this issue

How to locally save notification when app is terminated

$
0
0

Hello everyone. I am using one signal for notification but i have a problem. I have to locally save the notifications. But I cant do it when the app is terminated.

Touch and LongClick event on the same view in Android

$
0
0

Hi,

I have a use case with a Collectionview with custom views where a click/touch on a item will open a new page and a longclick will open a popup with some options for the view in the collection (remove, edit, etc).

From what I understand I can't implement this in Forms, I would have to use an effect or custom renderer. I thought I would be able to use the TouchEffect effect from the Xamarin documentation and its been working great for the Touch to open.
Now I would like to be able to use a LongClick/LongPress interaction as well. I've decided to modify the existing TouchEffect effect so that it also can fire a LongPressEvent. My TouchEffect class now looks like this:

public class TouchEffect : RoutingEffect
    {
        public event TouchActionEventHandler TouchAction;

        public event EventHandler<EventArgs> LongPressAction;

        public TouchEffect() : base("XamarinDocs.TouchEffect")
        {
        }

        public bool Capture { set; get; }

        public void OnTouchAction(Element element, TouchActionEventArgs args)
        {
            TouchAction?.Invoke(element, args);
        }

        public void OnLongPressAction(Element element, EventArgs args)
        {
            LongPressAction?.Invoke(element, args);
        }
    }

This works great in iOS, for the iOS platform effect I just added a UILongPressGestureRecognizer to the view and call the OnLongPressAction in its callback.

For Android I thought that I would be able to do the same and just add a callback to view.OnLongClick and call OnLongPressAction from there.
This does not seem to work since I also have a callback for view.OnTouch that sets the event.Handled to true, and setting event.Handled to false would mean that that other events like MotionEventActions.Up wont fire.

I read here that if I want to be able to use both OnClick and OnTouch that I would need a GestureDetector. Does that mean that I need a custom renderer? Is there any other way to solve this?
Any input would be greatly appreciated.

How to Refresh CollectionView ItemTemplate

$
0
0

xaml:

   <ContentPage.Resources>
        <ResourceDictionary>
            <Style x:Key="darkerButton" TargetType="Button">
                <Setter Property="BackgroundColor" Value="#ddd"/>
                <Setter Property="TextColor" Value="Black" />
                <Setter Property="BorderColor" Value="Blue"/>
                <Setter Property="FontSize" Value="Default" />
                <Setter Property="CornerRadius" Value="10" />
            </Style>
        </ResourceDictionary>
    </ContentPage.Resources>
    <ContentPage.Content>
        <StackLayout>
            <Frame Style="{StaticResource FrameStyle}">
                <StackLayout >
                    <Label x:Name="ApointingPersonName"  Text="" Style="{StaticResource LableHeading}"/>
                    <Label x:Name="ApointingPersonTag"  Text="" Style="{StaticResource LableSubHeading}"/>
                </StackLayout>
            </Frame>
            <!--<StackLayout HeightRequest="90" BackgroundColor="#E8AD00">-->
            <Frame OutlineColor="#EFEFEF" HeightRequest="78" Margin="1" Padding="3">
                <CollectionView ItemsSource="{Binding dayList}">
                    <CollectionView.ItemsLayout>
                        <GridItemsLayout Orientation="Horizontal"  HorizontalItemSpacing="5" VerticalItemSpacing="1" />
                    </CollectionView.ItemsLayout>
                    <CollectionView.ItemTemplate>
                        <DataTemplate x:DataType="models:DayList">
                            <Button x:Name="DayButton" Text="{Binding BindDayDate }"  MinimumHeightRequest="25" Clicked="DayButton_Clicked" Style="{StaticResource darkerButton}"/>
                        </DataTemplate>
                    </CollectionView.ItemTemplate>
                </CollectionView>
            </Frame>
            <BoxView HeightRequest="1" BackgroundColor="MediumTurquoise"/>
            <Frame Style="{StaticResource FrameStyle}">
                <StackLayout>
                    <StackLayout>
                        <Label x:Name="SelectedDayHead" Text="" Style="{StaticResource LableHeading}" HorizontalTextAlignment="Center" LineBreakMode="HeadTruncation"/>
                    </StackLayout>
                    <ContentView x:Name="SlotNOView" IsVisible="False" >
                        <Label x:Name="SlotNOAvailable" Text="" FontSize="Medium" VerticalTextAlignment="Center" FontAttributes="Bold" TextColor="Red"/>
                    </ContentView>
                    <RefreshView x:Name="SlotContentView"  IsVisible="False">
                        <CollectionView x:Name="SlotListView">
                            <CollectionView.ItemsLayout>
                                <GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="5" VerticalItemSpacing="5" SnapPointsType="Mandatory"/>
                            </CollectionView.ItemsLayout>
                            <CollectionView.ItemTemplate>
                                <DataTemplate x:DataType="models:SlotListData">
                                    <StackLayout>
                                        <Button Text="{Binding slot}" Clicked="SelectedSlot_Clicked"/>
                                    </StackLayout>
                                </DataTemplate>
                            </CollectionView.ItemTemplate>
                        </CollectionView>
                    </RefreshView>
                </StackLayout>
            </Frame>
        </StackLayout>
    </ContentPage.Content>

xaml.cs:

namespace EZQueue.Views.BookAppointment
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class TimeSlotList : ContentPage
    {
        VMTimeSlotList VMModel;
        public ServiceSlot serviceSlot { get; set; }
        public WorkTemplate workTemplate { get; set; }
        public ApointingPerson apointingPerson { get; set; }
        DayList dayList { get; set; }

        public TimeSlotList(ServiceSlot InputServiceSlot,ApointingPerson InputapointingPerson)
        {
            InitializeComponent();
            apointingPerson = InputapointingPerson;
            ApointingPersonName.Text = apointingPerson.Name;
            ApointingPersonTag.Text = InputServiceSlot.TagList;
            serviceSlot = InputServiceSlot;
            VMModel = new VMTimeSlotList(serviceSlot);
            BindingContext = VMModel;
            GetTimeSlotList();
            GetWorkTemplateList();
            GetCancelServiceList();
        }

        async void GetTimeSlotList()
        {
            await VMModel.RefreshListAsync();
        }

        async void GetWorkTemplateList()
        {
            await VMModel.RefreshWorkTemplateAsync();
        }

        async void GetCancelServiceList()
        {
            await VMModel.RefreshGetCancelServiceAsync();
        }

        async void GetSlotListData()
        {
            await VMModel.RefreshGetSlotListDataAsync();
            SlotListView.ItemsSource = VMModel.SlotListDataGroup;
            SlotContentView.IsVisible = true;
        }
        private void DayButton_Clicked(object sender, EventArgs e)
        {
            SlotContentView.IsVisible = false;
            SlotNOView.IsVisible = false;
            Button btn = (Button)sender;
            dayList=(DayList)btn.BindingContext;
            VMTimeSlotList.SelectedDate = DateTime.Parse(dayList.date);
            SelectedDayHead.Text = dayList.dayString + ", " + dayList.date;
            checkSoltAvailableORNot();
        }

        public void checkSoltAvailableORNot()
        {
            switch (dayList.dayString)
            {
                case
                                "Monday":
                    if (VMModel.workTemplate.Monday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;

                case
                              "Tuesday":
                    if (VMModel.workTemplate.Tuesday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;

                case
                            "Wednesday":
                    if (VMModel.workTemplate.Wednesday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;

                case
                            "Thursday":
                    if (VMModel.workTemplate.Thursday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;

                case
                            "Friday":
                    if (VMModel.workTemplate.Friday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;

                case
                            "Saturday":
                    if (VMModel.workTemplate.Saturday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;

                case
                            "Sunday":
                    if (VMModel.workTemplate.Sunday == true)
                    {
                        GetSlotListData();
                    }
                    else
                    {
                        slotNOAvailable();
                    }
                    break;
            }
        }

        public void slotNOAvailable()
        {
            SlotNOAvailable.Text = "Slot NOT Available...!!";
            SlotNOView.IsVisible = true;
        }


        private void SelectedSlot_Clicked(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            SlotListData SelectedTime = (SlotListData)btn.BindingContext;
            Navigation.PushAsync(new CustomerDetail(SelectedTime,VMModel.workTemplate,apointingPerson,dayList) { Title = "Patient Details" });
        }
    }
}

vMmodel:
namespace EZQueue.ViewModels
{
    public class CancelStartEnd
    {
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
    }

    public class VMTimeSlotList : INotifyPropertyChanged
    {
        public ObservableCollection<DayList> dayListAll { get; set; } = new ObservableCollection<DayList>();
        public ObservableCollection<DayList> dayList { get; set; } = new ObservableCollection<DayList>();

        public ObservableCollection<CancelService> cancelServiceAll { get; set; } = new ObservableCollection<CancelService>();
        public ObservableCollection<CancelService> cancelService { get; set; } = new ObservableCollection<CancelService>();
        public CancelStartEnd cancelStartEnd { get; set; } = new CancelStartEnd();

        public WorkTemplate workTemplateAll { get; set; } = new WorkTemplate();
        public WorkTemplate workTemplate { get; set; } = new WorkTemplate();

        public List<SlotListData> SlotListDataGroupAll { get; set; } = new List<SlotListData>();
        public List<SlotListData> SlotListDataGroup { get; set; } = new List<SlotListData>();

        DateTime TodayDate = DateTime.Today.AddDays(0);
        public ObservableCollection<Appointment> appointment { get; set; } = new ObservableCollection<Appointment>();

        public int serviceSlotID { get; set; }

        public static DateTime SelectedDate { get; set; }
        public List<string> BookedAppointmentTime { get; set; } = new List<string>();

        public VMTimeSlotList(ServiceSlot InputServiceSlot)
        {
            serviceSlotID = InputServiceSlot.ServiceSlotID;
        }

        private void UpdatelistDayList()
        {
            dayList.Clear();
            foreach (var item in dayListAll)
            {
                dayList.Add(item);
            }

            UpdateUserPromt();
        }

        public async Task RefreshListAsync()
        {
            IsRefreshing = true;
            try
            {
                dayListAll = await WebManager.GetDayListAsync(TodayDate, serviceSlotID);
                UpdatelistDayList();
            }
            catch { }
            IsRefreshing = false;
        }

        private void UpdateWorkTemplate()
        {
            workTemplate = workTemplateAll;
            UpdateUserPromt();
        }

        private void UpdateSlotListData()
        {
            SlotListDataGroup.Clear();
            foreach (var item in SlotListDataGroupAll)
            {
                SlotListDataGroup.Add(item);
            }
            UpdateUserPromt();
        }

        public async Task RefreshWorkTemplateAsync()
        {
            IsRefreshing = true;
            try
            {
                workTemplateAll = await WebManager.GetWorkTemplateAsync(serviceSlotID);
                UpdateWorkTemplate();
            }
            catch {}
            IsRefreshing = false;
        }

        public async Task RefreshGetSlotListDataAsync()
        {
            IsRefreshing = true;
            try
            {
                await getCancelServiceAsync();
                await getappointmentAsync();
                SlotListDataGroupAll.Clear();
                DateTime StartTime = workTemplate.StartTime;
                DateTime EndTime = workTemplate.EndTime;
                TimeSpan span = EndTime.Subtract(StartTime);
                int TotalMinutes = (int)span.TotalMinutes;
                int TimeSpan = (int)workTemplate.SlotGranularity.TotalMinutes;
                int count = TotalMinutes / TimeSpan;
                DateTime dateTime = StartTime;

                DateTime t2 = Convert.ToDateTime((cancelStartEnd.StartTime.ToShortTimeString()));
                DateTime t3 = Convert.ToDateTime((cancelStartEnd.EndTime.ToShortTimeString()));
                for (int j = 0; j < count; j++)
                {
                    DateTime t1 = Convert.ToDateTime((dateTime.ToShortTimeString()));
                    int v1 = DateTime.Compare(t1, t2);
                    int v2 = DateTime.Compare(t1, t3);

                    /* if t1 is less than t2 then result is -1 
                     *   if t1 equals t2 then result is 0 
                     *   if t1 is greater than t2 then result 1 
                     */

                    if (!(BookedAppointmentTime.Contains(dateTime.ToShortTimeString()))&&((v1>=0) & v2>=0 )||(v1<0 & v2<0)&&!(BookedAppointmentTime.Contains(dateTime.ToShortTimeString())))
                    {
                        SlotListDataGroupAll.Add(new SlotListData() { slot = dateTime.ToShortTimeString() });
                    }
                    dateTime = dateTime.AddMinutes(TimeSpan);
                }
                UpdateSlotListData();
            }
            catch(Exception e) { }
            IsRefreshing = false;
        }

        public async Task RefreshGetCancelServiceAsync()
        {
            cancelServiceAll = await WebManager.GetCancelServiceAsync(workTemplate.ServiceSlotID);
        }

        private async Task getCancelServiceAsync()
        {
            foreach (var item in cancelServiceAll)
            { 
                if(SelectedDate.ToShortDateString()==item.Date.ToShortDateString())
                {
                    cancelStartEnd=new CancelStartEnd() { StartTime = item.StartTime, EndTime = item.EndTime };
                }
            }
        }

        private async Task getappointmentAsync()
        {
            string ServiceSlotIDSelectedDate = workTemplate.ServiceSlotID.ToString() + "," + SelectedDate.ToString();
            appointment = await WebManager.GetAppointmentAsync(ServiceSlotIDSelectedDate);
            BookedAppointmentTime.Clear();
            foreach (var item in appointment)
            {
                BookedAppointmentTime.Add(item.StartTime.ToShortTimeString());
            }
        }
        public void UpdateUserPromt()
        {
            if (0 == SlotListDataGroupAll.Count)
            {
                if (false == NetworkInterface.GetIsNetworkAvailable())
                {
                    ShowMessage(EZQResource.SMInternateNotAvailable, true);
                }
            }
        }

        public void ShowMessage(string Message, bool bIsError = false)
        {
            UserPromt = Message;
            if (bIsError)
            {
                UserPromtColor = Color.Red;
            }
            else
            {
                UserPromtColor = Color.Black;
            }
        }

        public string m_UserPromt = "";
        public string UserPromt
        {
            get
            {
                return m_UserPromt;
            }
            set
            {
                if (m_UserPromt != value)
                {
                    m_UserPromt = value;
                    NotifyPropertyChanged();
                }
            }
        }

        public Color m_UserPromtColor;
        public Color UserPromtColor
        {
            get
            {
                return m_UserPromtColor;
            }
            set
            {
                if (m_UserPromtColor != value)
                {
                    m_UserPromtColor = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private bool m_isRefreshing = false;
        public bool IsRefreshing
        {
            get { return m_isRefreshing; }
            set
            {
                if (m_isRefreshing != value)
                {
                    m_isRefreshing = value;
                    NotifyPropertyChanged();
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        void NotifyPropertyChanged([CallerMemberName] string name = "")
        {
            if (name != "")
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
            }
        }
    }
}

data ~~~~
DayList:
  public class DayList
    {
        public int serviceSlotID { get; set; }
        public string dayString { get; set; }
        public string date { get; set; }
        public string BindDayDate {
            get
            {
                return string.Format("{0} \n{1}", dayString,DateTime.Parse(date).ToShortDateString());
            }
        }
    }

classWorkTemplate:~~~~

 public class WorkTemplate
    {
        public int WorkTemplateID { get; set; }
        public string Name { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public TimeSpan SlotGranularity { get; set; }

        public bool Monday { get; set; }
        public bool Tuesday { get; set; }
        public bool Wednesday { get; set; }
        public bool Thursday { get; set; }
        public bool Friday { get; set; }
        public bool Saturday { get; set; }
        public bool Sunday { get; set; }

        public int ServiceSlotID { get; set; }
    }

VideoLink:
https://youtu.be/kpKBlJ91wyo

Viewing all 89864 articles
Browse latest View live