This is a migrated thread and some comments may be shown as answers.

Event inside the RadGridview with MVVM pattern.

5 Answers 381 Views
GridView
This is a migrated thread and some comments may be shown as answers.
deepak
Top achievements
Rank 1
deepak asked on 20 Apr 2011, 04:09 PM
I am developing a silverlight  (Version 4) navigation application  with
1. MVVM pattern
2. PRISM 4 framework
3. RIA services
4. Telerik Silverlight Controls (latest version)

I want to call a model view in MVVM pattern  from the RadGridview.

I am attaching the code sample..
----------------------------------------------------------------

The view (UI) is :  
1.
 <telerik:RadGridView x:Name="CAGrid" Grid.Row="0" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" RowIndicatorVisibility="Collapsed"
                                    ItemsSource="{Binding ConfirmedAppointmentList,Mode=OneWay}"   AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"    HorizontalAlignment="Left" Height="auto"
                                    Width="Auto" MinWidth="326"  ShowGroupPanel="False" RowHeight="30" GridLinesVisibility="None" LostFocus="CAGrid_LostFocus" >
                                                               
                                                               
                                                           
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90"  />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">

                                                                                    <telerik:RadButton Click="GrdBtn_Click" Margin="0,0,1,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FF722525" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.CanceThisAppointment, Source={StaticResource ResourceWrapper}}"   x:Name="rbCancelApp"  Command="{Binding CmdCancelAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                     <!--<telerik:RadButton Margin="0,0,1,0" x:Name="rbCancelApp" Click="rbCancelApp_Click">-->
                                                                                        <Image  Margin="0,0,0,0" VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Cancel_this_appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   VerticalAlignment="Center" Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.GetOnWaitList, Source={StaticResource ResourceWrapper}}" x:Name="rbPOWaitListApp"  VerticalAlignment="Center"  Command="{Binding CmdGetOnWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Get_on_waitlist.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" VerticalAlignment="Center"  x:Name="rbViewCalender"   Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                             
                                                            </telerik:RadGridView>

2. The code behind  is as..

using System.ComponentModel.Composition;
using System.Windows.Controls;
using OT.Patient.ViewModel;
using System.Windows.Resources;
using System.IO;
using System.Collections.Generic;
using OT.Patient.Utility;
using OT.Core.Utility;
using System.Windows.Browser;
using System;

namespace OT.Patient.View
{
  [Export(typeof(DashboardView))]
  [PartCreationPolicy(CreationPolicy.NonShared)]
  public partial class DashboardView : UserControl
  {
    public DashboardView()
    {
      InitializeComponent();
          
               
    }
    [Import]
    public DashboardViewModel ViewModel
    {
      get { return this.DataContext as DashboardViewModel; }
      set { this.DataContext = value; }
    }

    #region AdvanceSearh
    private void lstAvailability_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        //Updated.
        if (lstAvailability.SelectedIndex != -1)
        {
            foreach (var item in lstAvailability.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SpecialtyToName = DashboardViewModel.SpecialtyToName + "," + Keyitem.Value;

            }

        }
    }

    private void lstSpecialtiesPrimary_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (lstSpecialtiesPrimary.SelectedIndex != -1)
        {
            foreach (var item in lstSpecialtiesPrimary.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SelectedPrimaryList = DashboardViewModel.SelectedPrimaryList + "," + Keyitem.Value;

            }

        }
    }

    private void lstSpecialtiesSecondry_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (lstSpecialtiesSecondry.SelectedIndex != -1)
        {
            foreach (var item in lstSpecialtiesSecondry.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SelectedSecondryList = DashboardViewModel.SelectedSecondryList + "," + Keyitem.Value;

            }

        }
    }

    private void lstSpecialty_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (lstSpecialty.SelectedIndex != -1)
        {
            foreach (var item in lstSpecialty.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SpecialtyToName = DashboardViewModel.SpecialtyToName + "," + Keyitem.Value;

            }

        }

    }
   
    #endregion

    bool gridClick = false;
    string type = string.Empty;
    private void CAGrid_LostFocus(object sender, System.Windows.RoutedEventArgs e)
    {
       
    }
 .........

 

3. The viewmodel code is as ..

using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
using System.Windows;
using OT.Patient.View;
using OT.Patient.Asset.Resource;
using OT.Patient.Web.Service;
using System.IO;
using System.Xml;
using System.Windows.Documents;
using System.Windows.Markup;
using System.Collections.Generic;

namespace OT.Patient.ViewModel
{
    [Export]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class DashboardViewModel : ViewModelBase, IPageTitle
    {
      

    [ImportingConstructor]
        public DashboardViewModel(IRegionManager regionManager)
        {
         
        _regionManager = regionManager;
         .......
         }
   public DashboardViewModel()
        {
         
            this._cmdCancelAppointment = new DelegateCommand<object>(CancelAppointment_Click);
            .......
         }

     private DelegateCommand<object> _cmdCancelAppointment;
        public DelegateCommand<object> CmdCancelAppointment
        {
            get { return _cmdCancelAppointment; }
            set { _cmdCancelAppointment = value; }
        }

      private void CancelAppointment_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            CancelAppointment(appointmentId);
        }

     private void CancelAppointment(int aId)
        {
            AppointmentModificationView childAppointmentModificationView = new AppointmentModificationView(this);
            childAppointmentModificationView.Show();
        }

    }

 


---------------------------------------------------------

Whenever i will call the event it will fire an managed/unmanaged error.
I have attached the error.

Please lets me know, if i am missing something.

Thanks
Deepak
deepak.joshi@icreon.net

5 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 21 Apr 2011, 08:19 AM
Hi deepak,

Could you confirm that you are using our latest official release (2011.Q1.SP1 - 2011.1.419), since we fixed a similar issue lately?

Best wishes,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
deepak
Top achievements
Rank 1
answered on 21 Apr 2011, 11:57 AM
I am using Telerik Version : 2010.2.924.1040

And in XAML the namesapces are like. Which is taken from examples in http://www.telerik.com site.

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
    xmlns:vm="clr-namespace:OT.Patient.ViewModel"
    xmlns:local="clr-namespace:OT.Patient"

   I am sending a snapshot of this too.
  
Thanks
Deepak.
0
deepak
Top achievements
Rank 1
answered on 29 Apr 2011, 02:21 PM
Hi..

The open popup issue from the RadgridView has been reslove, when i replace the Telerik.windows.Controls.dll with the new version, which release on April 2011.

Thanks
Deepak.
0
deepak
Top achievements
Rank 1
answered on 02 May 2011, 12:03 PM
Hi ,

 I have used 2011.Q1.SP1 - 2011.1.419 version and it has resolved by Open Popup from RadGridview is relsolve.
Thanks
But  i have got another issue.... as

I am using "RadTileView" in my dashboard page.
Before using the new dll it was changed the TileState as a result i can see the Small and Lagre content.
But now I am unable to see the lager content.
I mean to say, my RadTileView expand option is not working .

I am using the following code, which was working wilth Telerik Version : 2010.2.924.1040 but now its not work with 2011.1.419 version .
Please lets me know if i missing something.

The code is as..

The XAML is like..
-----------

<UserControl xmlns:my="clr-namespace:OT.Patient.View"  x:Class="OT.Patient.View.DashboardView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
    xmlns:vm="clr-namespace:OT.Patient.ViewModel"
    xmlns:local="clr-namespace:OT.Patient"
    xmlns:profileCompleteness="clr-namespace:OT.Patient.View"
    xmlns:myControl="clr-namespace:OT.Core.CustomControl;assembly=OT.Core"
    mc:Ignorable="d"
    d:DesignHeight="2500"  d:DesignWidth="994">

    <UserControl.Resources>
        <vm:DashboardViewModel x:Key="ViewModel"></vm:DashboardViewModel>

        <local:FluidContentStateConverter x:Key="myConverter"></local:FluidContentStateConverter>
        <Style x:FieldModifier="icon" TargetType="Image">
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="Margin" Value="0 3 0 0"/>
        </Style>
        <Style x:Key="ChildWindowStyle1" TargetType="sdk:ChildWindow">
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="TabNavigation" Value="Cycle"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="OverlayBrush" Value="#7F000000"/>
            <Setter Property="OverlayOpacity" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="sdk:ChildWindow">
                        <Grid x:Name="Root">

                            <Grid.Resources>
                                <Style x:Key="ButtonStyle" TargetType="Button">
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="Foreground" Value="#FF000000"/>
                                    <Setter Property="Padding" Value="3"/>
                                    <Setter Property="BorderThickness" Value="1"/>
                                    <Setter Property="BorderBrush">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9" Offset="0"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Grid x:Name="grid" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" Width="15" Background="#02FFFFFF">
                                                    <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                            <VisualState x:Name="Normal"/>
                                                            <VisualState x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.95"/>
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Pressed">
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.85"/>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Disabled">
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                                                </Storyboard>
                                                            </VisualState>
                                                        </VisualStateGroup>
                                                    </VisualStateManager.VisualStateGroups>
                                                    <Path x:Name="X_Fuzz2" Fill="#14C51900" Stretch="Fill" Stroke="#14C51900" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                                                        <Path.RenderTransform>
                                                            <TransformGroup>
                                                                <ScaleTransform ScaleX="1.3" ScaleY="1.3"/>
                                                            </TransformGroup>
                                                        </Path.RenderTransform>
                                                    </Path>
                                                    <Path x:Name="X_Fuzz1" Fill="#1EC51900" Stretch="Fill" Stroke="#1EC51900" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                                                        <Path.RenderTransform>
                                                            <TransformGroup>
                                                                <ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
                                                            </TransformGroup>
                                                        </Path.RenderTransform>
                                                    </Path>
                                                    <Path x:Name="X_Fuzz0" Fill="#FFC51900" Stretch="Fill" Stroke="#FFC51900" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z"/>
                                                    <Path x:Name="X" Fill="#FFFFFFFF" Stretch="Fill" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="0.7" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                                                        <Path.Stroke>
                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                <GradientStop Color="#FF313131" Offset="1"/>
                                                                <GradientStop Color="#FF8E9092" Offset="0"/>
                                                            </LinearGradientBrush>
                                                        </Path.Stroke>
                                                    </Path>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="WindowStates">
                                    <VisualState x:Name="Open">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="Overlay" Storyboard.TargetProperty="Opacity">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                                <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                                <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Closed">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="Overlay" Storyboard.TargetProperty="Opacity">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="Overlay" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Opacity="{TemplateBinding OverlayOpacity}" Background="{TemplateBinding OverlayBrush}"/>
                            <Grid x:Name="ContentRoot" Height="{TemplateBinding Height}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
                                <Grid.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Grid.RenderTransform>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="25"/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Border x:Name="Chrome" Width="Auto" BorderThickness="0,0,0,1" Margin="0,0,0,-22" CornerRadius="6">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,0.527999997138977" StartPoint="0.5,0">
                                                <GradientStop Color="#FF85C7CB"/>
                                                <GradientStop Color="#FF318C99" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <Grid Height="Auto" Width="Auto">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width=".7*" />
                                                <ColumnDefinition Width=".3*"/>
                                            </Grid.ColumnDefinitions>
                                            <ContentControl FontWeight="Bold" IsTabStop="False" Foreground="White" HorizontalAlignment="Left" Margin="10,10,6,0" Content="{TemplateBinding Title}" FontSize="14.667" FontFamily="Trebuchet MS" d:LayoutOverrides="Height">
                                                <ContentControl.Effect>
                                                    <DropShadowEffect ShadowDepth="0" BlurRadius="0" Opacity="0.8" Direction="245"/>
                                                </ContentControl.Effect>
                                            </ContentControl>
                                            <Button x:Name="CloseButton" IsTabStop="False" HorizontalAlignment="Right" Style="{StaticResource ButtonStyle}" Width="22" Grid.Column="1" Margin="0,-3,5,8"/>
                                        </Grid>
                                    </Border>
                                    <Border Margin="0" Grid.Row="1" Background="{TemplateBinding Background}">
                                        <ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="0,11,0,-11"/>
                                    </Border>
                                </Grid>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="TextBlock" x:Key="HeaderTitle">
            <Setter Property="FontSize" Value="12" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="Foreground" Value="White"/>
        </Style>
        <Style TargetType="Border" x:Key="pagingbackground">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush" Value="#ffc8d8e8"/>
        </Style>

        <Style TargetType="Button" x:Key="e_btn">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Width" Value="28"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Margin" Value="0,0,6,0"/>
        </Style>
        <Style TargetType="TextBlock" x:Key="SmallBox">
            <Setter Property="FontSize" Value="12" />
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Padding" Value="10 0" />
            <Setter Property="Margin" Value="0 0 0 50" />
        </Style>
        <Style TargetType="TextBlock" x:Key="label_text">
            <Setter Property="FontSize" Value="12" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="Margin" Value="0,0,0,6"/>
        </Style>
        <Style  TargetType="TextBox" x:Key="txtbox">
            <Setter Property="FontSize" Value="12" />
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="Margin" Value="0 0 0 0"/>
            <Setter Property="Width" Value="320"/>
        </Style>
        <Style  TargetType="TextBox" x:Key="txtbox_sml">
            <Setter Property="FontSize" Value="12" />
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="Margin" Value="0 0 0 0"/>
            <Setter Property="Width" Value="100"/>
        </Style>
        <Style TargetType="TextBlock" x:Key="green_font">
            <Setter Property="FontSize" Value="13" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="Foreground" Value="#FF96C647"/>
            <Setter Property="Margin" Value="0 0 0 5"/>
        </Style>
        <Style TargetType="Border" x:Key="greenborder">
            <Setter Property="BorderBrush" Value="#FF96C647"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="Margin" Value="0 10 10 10"/>
        </Style>
        <Style TargetType="Border" x:Key="blueborder">
            <Setter Property="BorderBrush" Value="#FF2C5486"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="Margin" Value="0,0,10,10"/>
        </Style>
        <Style TargetType="TextBlock" x:Key="HeaderTitleBlue">
            <Setter Property="FontSize" Value="18" />
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="Foreground" Value="#FF2C5486"/>
        </Style>
       
        <SolidColorBrush x:Key="GridView_HeaderInnerBorder" Color="Transparent"/>
        <SolidColorBrush x:Key="GridView_HeaderOuterBorder_Over" Color="Transparent"/>
        <SolidColorBrush x:Key="GridView_HeaderInnerBorder_Over" Color="Transparent"/>
        <LinearGradientBrush x:Key="GridView_HeaderBackground_Over" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Transparent" Offset="1"/>
            <GradientStop Color="Transparent" Offset="0"/>
            <GradientStop Color="Transparent" Offset="0.43"/>
            <GradientStop Color="Transparent" Offset="0.42"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_HeaderOuterBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Transparent" Offset="0"/>
            <GradientStop Color="Transparent" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_HeaderInnerBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Black"/>
            <GradientStop Color="Black" Offset="0.126"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_HeaderBackground_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFD74E" Offset="0.996"/>
            <GradientStop Color="#FFFFDCAB" Offset="0.17"/>
            <GradientStop Color="#FFFFB062" Offset="0.57"/>
            <GradientStop Color="#FFFFD18F" Offset="0.56"/>
            <GradientStop Color="#FFFFBA74"/>
        </LinearGradientBrush>
        <Style x:Key="StretchedContentControl" TargetType="ContentControl">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        </Style>
        <SolidColorBrush x:Key="GridView_SortIndicatorColor" Color="Red"/>
        <telerik:Office_BlackTheme x:Key="Theme"/>
        <Style x:Key="ColumnHeaderGripperStyle" TargetType="Thumb">
            <Setter Property="Width" Value="0"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0,0,0,0"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Cursor" Value="SizeWE"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Thumb">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="GridView_HeaderForeground_Selected" Color="Black"/>
        <SolidColorBrush x:Key="GridView_HeaderOuterBorder" Color="Transparent"/>
        <ControlTemplate x:Key="GridViewHeaderCellTemplate" TargetType="telerik:GridViewHeaderCell">
            <Grid x:Name="PART_HeaderCellGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition GeneratedDuration="00:00:00.2000000" To="Normal"/>
                            <VisualTransition GeneratedDuration="00:00:00.2000000" To="MouseOver"/>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Over">
                                    <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
                                </DoubleAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Ascending">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Selected">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Descending">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderTransform" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <ScaleTransform ScaleY="1" ScaleX="1"/>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Selected">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border x:Name="GridViewHeaderCell" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2">
                    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder}" BorderThickness="0" Background="{TemplateBinding Background}"/>
                </Border>
                <Border x:Name="GridViewHeaderCell_Over" BorderBrush="Transparent" BorderThickness="0" Grid.ColumnSpan="2" Opacity="0">
                    <Border BorderBrush="Transparent" BorderThickness="0" Background="Transparent"/>
                </Border>
                <Border x:Name="GridViewHeaderCell_Selected" BorderBrush="Transparent" BorderThickness="0" Grid.ColumnSpan="2" Opacity="0">
                    <Border BorderBrush="Transparent" BorderThickness="0" Background="Transparent"/>
                </Border>
                <ContentControl x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="{TemplateBinding IsTabStop}" Margin="{TemplateBinding Padding}" Style="{StaticResource StretchedContentControl}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                <Path x:Name="PART_SortIndicator" Grid.ColumnSpan="2" Data="M0,0 L1,0 2,0 3,0 4,0 5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z" Fill="{StaticResource GridView_SortIndicatorColor}" HorizontalAlignment="Center" Height="3" Margin="0,3,0,0" Opacity="0" RenderTransformOrigin=".5,.5" Stretch="Fill" VerticalAlignment="Top" Width="5">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="-1" ScaleX="1"/>
                            <SkewTransform AngleY="0" AngleX="0"/>
                            <RotateTransform Angle="0"/>
                            <TranslateTransform X="0" Y="0"/>
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
                <telerik:FilteringDropDown x:Name="PART_DistinctFilterControl" Grid.Column="1" Margin="0,0,8,0" telerik:StyleManager.Theme="{StaticResource Theme}" Visibility="{TemplateBinding FilteringUIVisibility}"/>
                <Thumb x:Name="PART_LeftHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Left" IsTabStop="{TemplateBinding IsTabStop}" Style="{StaticResource ColumnHeaderGripperStyle}"/>
                <Thumb x:Name="PART_RightHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Right" IsTabStop="{TemplateBinding IsTabStop}" Style="{StaticResource ColumnHeaderGripperStyle}"/>
            </Grid>
        </ControlTemplate>
        <LinearGradientBrush x:Key="GridView_HeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color=" #FFDADBDC" />
            <GradientStop Color=" #FFDADBDC"/>
            <GradientStop Color=" #FFDADBDC" />
            <GradientStop Color=" #FFDADBDC"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="GridView_HeaderForeground" Color="Black" />
        <Style TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Template" Value="{StaticResource GridViewHeaderCellTemplate}"/>
            <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridView_HeaderOuterBorder}"/>
            <Setter Property="BorderThickness" Value="0,0,0,0"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="5,0,3,0"/>
            <Setter Property="Foreground" Value="{StaticResource GridView_HeaderForeground}"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="10"/>
            <Setter Property="FontFamily" Value="Verdana"/>
        </Style>
        <Style x:Key="GridViewHeaderCellStyle1" TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Template" Value="{StaticResource GridViewHeaderCellTemplate}"/>
            <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridView_HeaderOuterBorder}"/>
            <Setter Property="BorderThickness" Value="0,0,0,0"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="5,0,3,0"/>
            <Setter Property="Foreground" Value="#fffdfdfd"/>
        </Style>
        <Style TargetType="telerik:GridViewHeaderRow">
            <Setter Property="Background" Value="#FFDADBDC" />
            <Setter Property="BorderThickness" Value="0,0,0,0"/>
        </Style>
        <SolidColorBrush x:Key="ItemOuterBorder_Over" Color="Transparent"/>
        <SolidColorBrush x:Key="ItemInnerBorder_Over" Color="Transparent"/>
        <LinearGradientBrush x:Key="ItemBackground_Over" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Transparent" Offset="1"/>
            <GradientStop Color="Transparent" Offset="0"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ItemOuterBorder_Selected" Color="Transparent"/>
        <SolidColorBrush x:Key="ItemInnerBorder_Selected" Color="Transparent"/>
        <SolidColorBrush x:Key="ItemBackground_Selected" Color="Transparent"/>
        <SolidColorBrush x:Key="ItemOuterBorder_Invalid" Color="#FFCE7D7D"/>
        <LinearGradientBrush x:Key="ItemInnerBorder_Invalid" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFEBF4FD"/>
            <GradientStop Color="#FFDBEAFD" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ItemBackground_Invalid" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFCDCDC"/>
            <GradientStop Color="#FFFCC1C1" Offset="1"/>
        </LinearGradientBrush>
        <telerik:BooleanToOpacityConverter x:Key="BooleanToOpacityConverter"/>
        <telerik:GridLineWidthToThicknessConverter x:Key="GridLineWidthToThicknessConverter"/>
        <SolidColorBrush x:Key="ControlOuterBorder" Color="Transparent"/>
        <SolidColorBrush x:Key="GridView_HierarchyBackground" Color="Transparent"/>
        <SolidColorBrush x:Key="ControlInnerBorder" Color="White"/>
        <SolidColorBrush x:Key="GridView_RowIndicatorCellBackground" Color="Transparent"/>
        <SolidColorBrush x:Key="GridView_NavigatorIndicatorBackground" Color="Transparent"/>
        <SolidColorBrush x:Key="GridView_EditIndicatorBackground1" Color="Transparent"/>
        <SolidColorBrush x:Key="GridView_EditIndicatorBackground2" Color="#FFCBCBCB"/>
        <SolidColorBrush x:Key="GridView_EditIndicatorBackground3" Color="#FF848484"/>
        <SolidColorBrush x:Key="GridView_EditIndicatorBackground4" Color="White"/>
        <LinearGradientBrush x:Key="GridView_ErrorIndicatorBackground1" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFC9999" Offset="0"/>
            <GradientStop Color="#FFC26666" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="GridView_ErrorIndicatorBackground2" Color="White"/>
        <LinearGradientBrush x:Key="GridView_ErrorIndicatorBackground3" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Red" Offset="0"/>
            <GradientStop Color="#FF990000" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_RowIndicatorCellBackground_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#FFE4E4E4" Offset="1"/>
        </LinearGradientBrush>
        <ControlTemplate x:Key="GridViewRowTemplate" TargetType="telerik:GridViewRow">
            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused"/>
                        <VisualState x:Name="Focused">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="NavigatorIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="SelectionStates">
                        <VisualState x:Name="Unselected"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Background_Over">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Selected">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Background_Selected">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="NavigatorIndicatorBackground">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_RowIndicatorCellBackground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="ValueStates">
                        <VisualState x:Name="Valid"/>
                        <VisualState x:Name="Invalid">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Background_Invalid">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ErrorIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EditIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="NavigatorIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="EditStates">
                        <VisualState x:Name="ReadOnlyMode"/>
                        <VisualState x:Name="EditMode">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EditIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="NavigatorIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <telerik:SelectiveScrollingGrid x:Name="grid">
                    <telerik:SelectiveScrollingGrid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </telerik:SelectiveScrollingGrid.ColumnDefinitions>
                    <telerik:SelectiveScrollingGrid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </telerik:SelectiveScrollingGrid.RowDefinitions>
                    <Border x:Name="SelectionBackground" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" Grid.Column="2" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Margin}" Padding="{TemplateBinding Padding}" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    <Border x:Name="Background_Over" BorderBrush="{StaticResource ItemOuterBorder_Over}" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="Collapsed">
                        <Border BorderBrush="{StaticResource ItemInnerBorder_Over}" BorderThickness="1" Background="{StaticResource ItemBackground_Over}"/>
                    </Border>
                    <Border x:Name="Background_Selected" BorderBrush="{StaticResource ItemOuterBorder_Selected}" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="Collapsed">
                        <Border BorderBrush="{StaticResource ItemInnerBorder_Selected}" BorderThickness="1" Background="{StaticResource ItemBackground_Selected}"/>
                    </Border>
                    <Border x:Name="Background_Invalid" BorderBrush="{StaticResource ItemOuterBorder_Invalid}" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="Collapsed">
                        <Border BorderBrush="{StaticResource ItemInnerBorder_Invalid}" BorderThickness="1" Background="{StaticResource ItemBackground_Invalid}"/>
                    </Border>
                    <telerik:GridViewToggleButton x:Name="PART_HierarchyExpandButton" Grid.Column="2" IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}" IsTabStop="{TemplateBinding IsTabStop}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Opacity="{Binding IsExpandable, Converter={StaticResource BooleanToOpacityConverter}, RelativeSource={RelativeSource TemplatedParent}}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" telerik:StyleManager.Theme="{StaticResource Theme}" Visibility="{Binding HasHierarchy, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Width="25"/>
                    <Border Grid.Column="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HasHierarchy, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"/>
                    <telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="3" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <Border x:Name="PART_RowBorder" BorderBrush="{TemplateBinding HorizontalGridLinesBrush}" BorderThickness="{Binding HorizontalGridLinesWidth, ConverterParameter=Bottom, Converter={StaticResource GridLineWidthToThicknessConverter}, RelativeSource={RelativeSource TemplatedParent}}" Grid.ColumnSpan="4" Grid.Column="1" Grid.RowSpan="4" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" VerticalAlignment="Bottom"/>
                    <Border BorderBrush="{StaticResource ControlOuterBorder}" BorderThickness="0,1" Background="{StaticResource GridView_HierarchyBackground}" Grid.ColumnSpan="2" Grid.Column="2" Padding="6" Grid.Row="2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="{Binding IsExpanded, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}">
                        <ContentPresenter x:Name="PART_HierarchyChildPresenter" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True"/>
                    </Border>
                    <telerik:DetailsPresenter x:Name="PART_DetailsPresenter" Grid.ColumnSpan="2" Grid.Column="2" DetailsProvider="{TemplateBinding DetailsProvider}" Grid.Row="1" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="1" IndentLevel="{TemplateBinding IndentLevel}" Grid.RowSpan="4" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <Border x:Name="PART_IndicatorPresenter" BorderBrush="{StaticResource ControlOuterBorder}" BorderThickness="0,0,1,1" Grid.Column="0" Grid.RowSpan="3" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" VerticalAlignment="Stretch" Width="25">
                        <Border x:Name="NavigatorIndicatorBackground" BorderBrush="{StaticResource ControlInnerBorder}" BorderThickness="1" Background="{StaticResource GridView_RowIndicatorCellBackground}">
                            <Grid>
                                <Grid x:Name="NavigatorIndicator" HorizontalAlignment="Center" Height="11" Visibility="Collapsed" VerticalAlignment="Center" Width="11">
                                    <Path Data="F1 M 32.0234,6.66669L 24.2923,0.0248413L 28.3697,0.0248413L 32,3.14362L 36.1492,6.70819L 32,10.2728L 28.4664,13.3085L 24.2923,13.3085L 32.0234,6.66669 Z " Fill="{StaticResource GridView_NavigatorIndicatorBackground}" HorizontalAlignment="Center" Height="8" Margin="0" Stretch="Fill" VerticalAlignment="Center" Width="8"/>
                                </Grid>
                                <Grid x:Name="EditIndicator" HorizontalAlignment="Center" Height="10" Visibility="Collapsed" VerticalAlignment="Center" Width="16">
                                    <Path Data="M14,9 L15,9 15,10 14,10 z M1,9 L2,9 2,10 1,10 z M15,8 L16,8 16,9 15,9 z M0,8 L1,8 1,9 0,9 z M15,1 L16,1 16,2 15,2 z M0,1 L1,1 1,2 0,2 z M14,0 L15,0 15,1 14,1 z M1,0 L2,0 2,1 1,1 z" Fill="{StaticResource GridView_EditIndicatorBackground1}" Stretch="Fill"/>
                                    <Path Data="M0.99999994,6.9999995 L2,6.9999995 3,6.9999995 4,6.9999995 5,6.9999995 6,6.9999995 7,6.9999995 8,6.9999995 9,6.9999995 10,6.9999995 11,6.9999995 12,6.9999995 13,6.9999995 13,7.9999995 12,7.9999995 11,7.9999995 10,7.9999995 9,7.9999995 8,7.9999995 7,7.9999995 6,7.9999995 5,7.9999995 4,7.9999995 3,7.9999995&#xa;2,7.9999995 0.99999994,7.9999995 z M13,0.99999994 L14,0.99999994 14,1.9999999 14,2.9999995 14,3.9999995 14,4.9999995 14,5.9999995 14,6.9999995 13,6.9999995 13,5.9999995 13,4.9999995 13,3.9999995 13,2.9999995 13,1.9999999 z M0,0.99999994 L0.99999994,0.99999994 0.99999994,1.9999999 0.99999994,2.9999995 0.99999994,3.9999995 0.99999994,4.9999995 0.99999994,5.9999995 0.99999994,6.9999995 0,6.9999995 0,5.9999995 0,4.9999995 0,3.9999995 0,2.9999995 0,1.9999999 z M11,0 L12,0 13,0 13,0.99999994 12,0.99999994 11,0.99999994 10,0.99999994 9,0.99999994 8,0.99999994 7,0.99999994 6,0.99999994 5,0.99999994 4,0.99999994 3,0.99999994 2,0.99999994 0.99999994,0.99999994 0.99999994,2.3841858E-07 2,2.3841858E-07 3,2.3841858E-07 4,2.3841858E-07 5,2.3841858E-07 6,2.3841858E-07 7,2.3841858E-07 8,2.3841858E-07&#xa;9,2.3841858E-07 10,2.3841858E-07 z" Fill="{StaticResource GridView_EditIndicatorBackground2}" Margin="1" Stretch="Fill"/>
                                    <Path Data="M2,9 L3,9 4,9 5,9 6,9 7,9 8,9 9,9 10,9 11,9 12,9 13,9 14,9 14,10 13,10 12,10 11,10 10,10 9,10 8,10 7,10 6,10 5,10 4,10&#xa;3,10 2,10 z M14,8 L15,8 15,9 14,9 z M1,8 L2,8 2,9 1,9 z M15,2 L16,2 16,3 16,4 16,5 16,6 16,7 16,8 15,8 15,7 15,6 15,5 15,4 15,3 z M3,2 L4,2 5,2 6,2 6,3 5,3 5,4 5,5 5,6 5,7 6,7 6,8 5,8 4,8 3,8 3,7 4,7 4,6 4,5 4,4 4,3 3,3 z M0,2 L1,2 1,3 1,4 1,5 1,6 1,7 1,8 0,8 0,7 0,6 0,5 0,4 0,3 z M14,1 L15,1 15,2 14,2 z M1,1 L2,1 2,2 1,2 z M2,0 L3,0 4,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 13,0 14,0 14,1 13,1 12,1 11,1 10,1 9,1 8,1 7,1 6,1 5,1 4,1&#xa;3,1 2,1 z" Fill="{StaticResource GridView_EditIndicatorBackground3}" Stretch="Fill"/>
                                    <Path Data="M4,0 L5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12,1 12,2 12,3 12,4 12,5.0000001 12,6 11,6 10,6 9,6 8,6 7,6 6,6 5,6 4,6 4,5.0000001&#xa;3,5.0000001 3,4 3,3 3,2 3,1 4,1 z M0,0 L1,0 1,1 2,1 2,2 2,3 2,4 2,5.0000001 1,5.0000001 1,6 0,6 0,5.0000001 0,4 0,3 0,2 0,1 z" Fill="{StaticResource GridView_EditIndicatorBackground4}" Margin="2" Stretch="Fill"/>
                                </Grid>
                                <Grid x:Name="ErrorIndicator" HorizontalAlignment="Center" Height="16" Visibility="Collapsed" VerticalAlignment="Center" Width="16">
                                    <Path Data="M3,12.999999 L4,12.999999 5,12.999999 6,12.999999 7,12.999999 8,12.999999 9,12.999999 10,12.999999 11,12.999999 11,13.999999 10,13.999999 9,13.999999 8,13.999999 7,13.999999 6,13.999999 5,13.999999 4,13.999999 3,13.999999 z M11,11.999999 L12,11.999999 12,12.999999 11,12.999999 z M2.0000001,11.999999 L3,11.999999 3,12.999999 2.0000001,12.999999 z M12,10.999999 L13,10.999999 13,11.999999 12,11.999999 z M1,10.999999 L2.0000001,10.999999 2.0000001,11.999999 1,11.999999 z M13,2.9999992 L14,2.9999992 14,3.9999992 14,4.9999992 14,5.9999992 14,6.9999992 14,7.9999992 14,8.9999992 14,9.9999992 14,10.999999 13,10.999999 13,9.9999992 13,8.9999992 13,7.9999992 13,6.9999992 13,5.9999992 13,4.9999992 13,3.9999992 z M0,2.9999992 L1,2.9999992 1,3.9999992 1,4.9999992 1,5.9999992 1,6.9999992 1,7.9999992 1,8.9999992 1,9.9999992 1,10.999999 0,10.999999 0,9.9999992 0,8.9999992 0,7.9999992 0,6.9999992 0,5.9999992 0,4.9999992 0,3.9999992 z M12,1.9999999 L13,1.9999999 13,2.9999992 12,2.9999992 z M1,1.9999999 L2.0000001,1.9999999 2.0000001,2.9999992 1,2.9999992 z M11,0.99999994 L12,0.99999994 12,1.9999999 11,1.9999999 z M2.0000001,0.99999994 L2.9999998,0.99999994 2.9999998,1.9999999 2.0000001,1.9999999 z M2.9999998,0 L3.9999998,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 11,0.99999994 10,0.99999994 9,0.99999994 8,0.99999994 7,0.99999994 6,0.99999994 5,0.99999994 3.9999998,0.99999994 2.9999998,0.99999994 z" Fill="{StaticResource GridView_ErrorIndicatorBackground1}" Margin="1" Stretch="Fill"/>
                                    <Path Data="M1.4901161E-07,8 L1.0000001,8 2.0000002,8 2.0000002,9 2.0000002,10 1.0000003,10 1.0000003,9 1.0000001,10 1.4901161E-07,10 1.4901161E-07,9 z M1.4901161E-07,0 L1.0000001,0 2.0000002,0 2.0000002,1 2.0000002,2 2.0000002,3 2.0000002,4.0000001 2.0000002,5 2.0000002,5.9999999 2.0000002,7 1.0000001,7 1.4901161E-07,7 1.4901161E-07,5.9999999 1.4901161E-07,5 1.4901161E-07,4.0000001 1.4901161E-07,3 1.4901161E-07,2 0,1 z" Fill="{StaticResource GridView_ErrorIndicatorBackground2}" Margin="7,3" Stretch="Fill"/>
                                    <Path Data="M4,15 L5,15 6,15 7,15 8,15 9,15 10,15 11,15 12,15 12,16 11,16 10,16 9,16 8,16 7,16 6,16 5,16 4,16 z M12,14 L13,14 13,15 12,15 z M3,14 L4,14 4,15 3,15 z M13,13 L14,13 14,14 13,14 z M2,13 L3,13 3,14 2,14 z M14,12 L15,12 15,13 14,13 z M1,12 L2,12 2,13 1,13 z M7,11 L7,12 7,13 8,13 9,13 9,12 9,11 8,11 z M15,4 L16,4 16,5 16,6 16,7 16,8 16,9 16,10 16,11 16,12 15,12 15,11 15,10 15,9 15,8 15,7 15,6 15,5 z M0,4 L1,4 1,5 1,6 1,7 1,8 1,9 1,10 1,11 1,12 0,12 0,11 0,10 0,9 0,8 0,7 0,6 0,5 z M14,3 L15,3 15,4 14,4 z M7,3 L7,4 7,5 7,6 7,7 7,8 7,9 7,10 8,10 9,10 9,9 9,8 9,7 9,6 9,5 9,4 9,3 8,3 z M1,3 L2,3 2,4 1,4 z M13,2 L14,2 14,3 13,3 z M4,2 L5,2 6,2 7,2 8,2 9,2 10,2 11,2 12,2 12,3 13,3 13,4 14,4 14,5 14,6 14,7 14,8 14,9 14,10 14,11 14,12 13,12 13,13 12,13&#xa;12,14 11,14 10,14 9,14 8,14 7,14 6,14 5,14 4,14 4,13 3,13 3,12 2,12 2,11 2,10 2,9 2,8 2,7 2,6 2,5 2,4 3,4 3,3&#xa;4,3 z M2,2 L3,2 3,3 2,3 z M12,1 L13,1 13,2 12,2 z M3,1 L4,1 4,2 3,2 z M4,0 L5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12,1 11,1 10,1 9,1 8,1 7,1 6,1 5,1 4,1 z" Fill="{StaticResource GridView_ErrorIndicatorBackground3}" Stretch="Fill"/>
                                </Grid>
                            </Grid>
                        </Border>
                    </Border>
                </telerik:SelectiveScrollingGrid>
            </Border>                                                              
        </ControlTemplate>
        <SolidColorBrush x:Key="ItemBackground" Color="White"/>
        <SolidColorBrush x:Key="GridView_GridLinesItemBorder" Color="Transparent"/>
        <Style TargetType="telerik:GridViewRow">
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Template" Value="{StaticResource GridViewRowTemplate}"/>
            <Setter Property="Background" Value="{StaticResource ItemBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridView_GridLinesItemBorder}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
        </Style>
        <ControlTemplate x:Key="DataCellsPresenterTemplate" TargetType="telerik:DataCellsPresenter">
            <Grid>
                <ItemsPresenter/>
                <telerik:FrozenColumnsSplitter x:Name="PART_FrozenColumnsSplitter" HorizontalAlignment="Left" telerik:StyleManager.Theme="{StaticResource Theme}">
                    <telerik:FrozenColumnsSplitter.Background>
                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                            <GradientStop Color="Transparent"/>
                            <GradientStop Color="#00000000" Offset="1"/>
                        </LinearGradientBrush>
                    </telerik:FrozenColumnsSplitter.Background>
                </telerik:FrozenColumnsSplitter>
            </Grid>
        </ControlTemplate>
        <Style TargetType="telerik:DataCellsPresenter">
            <Setter Property="Template" Value="{StaticResource DataCellsPresenterTemplate}"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <telerik:GridViewCellsPanel/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <ScrollViewer VerticalScrollBarVisibility="Auto" Width="994" BorderThickness="0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>

            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Visibility="{Binding ShowMainDetails,Source={StaticResource ViewModel},Mode=TwoWay}" >
                <!--<StackPanel Grid.Row="0" Visibility="Visible" >-->
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Height="Auto" HorizontalAlignment="Left"  Visibility="{Binding KeyMessageVisibility}" Margin="10,5,0,5">

                        <TextBlock x:Name="txtErrors" Grid.Row="1" Grid.Column="0" Margin="10,0,0,10" TextWrapping="Wrap" Text="{Binding ErrorSummary, Source={StaticResource ViewModel},Mode=TwoWay}"  FontWeight="Bold" Width="Auto" Height="Auto" FontSize="11"  Foreground="{Binding ErrorSummaryForeground, Source={StaticResource ViewModel}, Mode=TwoWay}" ></TextBlock>

                        <Border Height="37" CornerRadius="8" Width="960">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF6AA0BC" Offset="0"/>
                                    <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <RichTextBox Margin="10,3,0,0"   Background="Transparent" Visibility="{Binding KeyMessageVisibility}"  BorderBrush="{x:Null}" BorderThickness="0" AcceptsReturn="False">
                                <Paragraph>
                                    <Run x:Name="rteKeyMessage" Text="{Binding KeyMessage, Mode=TwoWay}"></Run>
                                    <Hyperlink Command="{Binding NavigateNeedHelp,Source={StaticResource ViewModel}}"  >
                                        <Run Text="{Binding NeedHelpLink}"  />
                                    </Hyperlink>
                                </Paragraph>
                            </RichTextBox>
                        </Border>
                      

                    </StackPanel>
                    <StackPanel  Grid.Row="1">
                        <Grid x:Name="LayoutRoot">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="720"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Grid.Row="0" HorizontalAlignment="Left">

                                <Border CornerRadius="6"  BorderThickness="0" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2">
                                    <telerik:RadTileView  x:Name="RadTileView1" Width="720" Height="800" MaxColumns="2" BorderThickness="0" >
                                        <!--Confirmed appointment-->
                                        <telerik:RadTileViewItem  x:Name="ConfirmedAppointmentsSeries" BorderThickness="0" Background="#FFE8EFF6" TileStateChanged="ConfirmedAppointmentsSeries_TileStateChanged">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Confirmed Appointments" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl x:Name="fcntl" ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=ConfirmedAppointmentsSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="193" Height="130">
                                                            <TextBlock Text="Confirmed Appointments Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>

                                                            <telerik:RadGridView    x:Name="CAGrid"  Grid.Row="0" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" RowIndicatorVisibility="Collapsed"
                                    ItemsSource="{Binding ConfirmedAppointmentList,Mode=OneWay}"   AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"   HorizontalAlignment="Left" Height="auto"
                                    Width="Auto" MinWidth="326"  ShowGroupPanel="False" RowHeight="30" GridLinesVisibility="None" >
                                                               
                                                               
                                                           
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90"  />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">

                                                                                    <telerik:RadButton  Margin="0,0,1,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FF722525" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.CanceThisAppointment, Source={StaticResource ResourceWrapper}}"   x:Name="rbCancelApp"  Command="{Binding CmdCancelAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                     <!--<telerik:RadButton Margin="0,0,1,0" x:Name="rbCancelApp" Click="rbCancelApp_Click">-->
                                                                                        <Image  Margin="0,0,0,0" VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Cancel_this_appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   VerticalAlignment="Center" Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.GetOnWaitList, Source={StaticResource ResourceWrapper}}" x:Name="rbPOWaitListApp"  VerticalAlignment="Center"  Command="{Binding CmdGetOnWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Get_on_waitlist.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" VerticalAlignment="Center"  x:Name="rbViewCalender"   Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                             
                                                            </telerik:RadGridView>

                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0" Visibility="{Binding CAGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tdConfirmedAppointments" Text="You currently have no Confirmed Appointments."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>
                                                                                    
                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1" IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=CAGrid}"  Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left" />
                                                                    <HyperlinkButton Grid.Column="2"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>

                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>

                                                            <telerik:RadGridView    x:Name="CALGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                                ItemsSource="{Binding ConfirmedAppointmentList,Mode=OneWay}" AlternateRowBackground="AliceBlue"   GridLinesVisibility="None" AlternationCount="2" AutoGenerateColumns="False" HorizontalAlignment="Left" MinHeight="200"
                                                VerticalAlignment="Top" ShowGroupPanel="False" Width="auto">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90"  />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions"  UniqueName="Action" Width="100">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">

                                                                                    <telerik:RadButton Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.CanceThisAppointment, Source={StaticResource ResourceWrapper}}"   x:Name="rbCancelApp"  Command="{Binding CmdCancelAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0" VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Cancel_this_appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   VerticalAlignment="Center" Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.GetOnWaitList, Source={StaticResource ResourceWrapper}}" x:Name="rbPOWaitListApp"  VerticalAlignment="Center"  Command="{Binding CmdGetOnWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Get_on_waitlist.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" VerticalAlignment="Center"  x:Name="rbViewCalender"   Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding CAGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock  Text="You currently have no Confirmed Appointments."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" >
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1" IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=CAGrid}"  Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left" />
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>

                                                                </Grid>
                                                            </StackPanel>

                                                        </Grid>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Confirmed appointment ends-->
                                        <!--Pending Office Action-->
                                        <telerik:RadTileViewItem x:Name="PendingOfficeActionSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Pending Office Action" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=PendingOfficeActionSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="Pending Office Action Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>

                                                            <telerik:RadGridView    x:Name="POGrid" Grid.Row="0" BorderThickness="0"  ScrollViewer.VerticalScrollBarVisibility="Auto"
                                        RowIndicatorVisibility="Collapsed" ItemsSource="{Binding PendingOfficeActionList, Mode=TwoWay}"
                                        AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"
                                        HorizontalAlignment="Left" Height="120" ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                    Width="auto" MinWidth="326" VerticalAlignment="Top" ShowGroupPanel="False" RowHeight="30" Margin="2,-2,0,-11" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=TwoWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=TwoWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=TwoWay}" Header="Provider"  Width="*" />

                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel  Orientation="Horizontal">
                                                                                    <telerik:RadButton x:Name="rbCancelApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" Command="{Binding CmdCancelAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"   ToolTipService.ToolTip="Cancel this appointment"   VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Cancel_this_appointment.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbViewlApp"  Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}"  Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbRemoveFromWaitListApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.RemoveFromWaitList, Source={StaticResource ResourceWrapper}}"   Command="{Binding CmdRemoveMeFromWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"   Source="/OT.Patient;component/Asset/Image/Remove_me_from_waitlist.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0"  Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" x:Name="rbViewCalender" Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>

                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0"  Visibility="{Binding POGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tbPendingOfficeAction"  Text="You currently have no Pending Office Action. "/>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1"  IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=POGrid}"  Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent >
                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="POLGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                        AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"   GridLinesVisibility="None"
                                        HorizontalAlignment="Left" ItemsSource="{Binding PendingOfficeActionList, Mode=TwoWay}"
                                            VerticalAlignment="Top" ShowGroupPanel="False" MinHeight="200" MaxHeight="450">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=TwoWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=TwoWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=TwoWay}" Header="Provider"  Width="*" />

                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel  Orientation="Horizontal">
                                                                                    <telerik:RadButton x:Name="rbCancelApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" Command="{Binding CmdCancelAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"   ToolTipService.ToolTip="Cance this appointment"   VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/Cancel_this_appointment.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbViewlApp"  Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}"  Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">

                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbRemoveFromWaitListApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.RemoveFromWaitList, Source={StaticResource ResourceWrapper}}"   Command="{Binding CmdRemoveMeFromWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"   Source="/OT.Patient;component/Asset/Image/Remove_me_from_waitlist.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0"  Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" x:Name="rbViewCalender" Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding POGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock Text="You currently have no Pending Office Action."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" DisplayMode="PreviousNextNumeric" Grid.Column="1" Source="{Binding Items, ElementName=POLGrid}"  IsEnabled="False" PageSize="30"  
                                                NumericButtonCount="10"   AutoEllipsisMode="Both" IsTotalItemCountFixed="True" Style="{StaticResource dashboard_pager_style}" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>

 

                                                        </Grid>

                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Pending Office Action ends-->
                                        <!--Pending Patient Action-->
                                        <telerik:RadTileViewItem x:Name="PendingPatientActionSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Pending Patient Action" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=PendingPatientActionSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="Pending Patient Action Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>

                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="PPGrid" RowIndicatorVisibility="Collapsed"  BorderThickness="0"
                                    ItemsSource="{Binding PendingPatientActionList, Mode=TwoWay}"   ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                    AlternateRowBackground="AliceBlue" AlternationCount="2"  ScrollViewer.VerticalScrollBarVisibility="Auto"
                                    AutoGenerateColumns="False" HorizontalAlignment="Left" Height="120" Grid.Row="0"
                                    Width="auto" MinWidth="326" VerticalAlignment="Top" ShowGroupPanel="False" RowHeight="30" Margin="2,-2,0,-11" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton x:Name="rbConfirmApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ConfirmAppointment, Source={StaticResource ResourceWrapper}}"  Command="{Binding CmdConfirmAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/Confirm_Appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbDeclinedAppointment" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.DeclineAppointment, Source={StaticResource ResourceWrapper}}"   Command="{Binding CmdDeclineThisAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/decline_appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbViewlApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}"  ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}"  Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >

                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}"  ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" VerticalAlignment="Center"    Width="24"  Height="24"  Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>

                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>

                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0"  Visibility="{Binding PPGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tbPendingPatientAction" Text="You currently have no Pending Patient Action." />
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1"  IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=PPGrid}" Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                        <!--</StackPanel>
                                       
                                </ScrollViewer>-->
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>
                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="PPLGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                        AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"  GridLinesVisibility="None"
                                        HorizontalAlignment="Left" ItemsSource="{Binding PendingPatientActionList, Mode=TwoWay}"
                                            VerticalAlignment="Top" ShowGroupPanel="False" MinHeight="200" MaxHeight="450">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton x:Name="rbConfirmApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ConfirmAppointment, Source={StaticResource ResourceWrapper}}"  Command="{Binding CmdConfirmAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/Confirm_Appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbDeclinedAppointment" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.DeclineAppointment, Source={StaticResource ResourceWrapper}}"   Command="{Binding CmdDeclineThisAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/decline_appointment.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton x:Name="rbViewlApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}"  ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}"  Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >

                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}"  ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewCalender, Source={StaticResource ResourceWrapper}}" VerticalAlignment="Center"  x:Name="rbViewCalender"  Width="24"  Height="24"  Command="{Binding CmdViewCalender, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Calendar.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>

                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>

                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding PPGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock  Text="You currently have no pending patient action."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" DisplayMode="PreviousNextNumeric" Grid.Column="1" Source="{Binding Items, ElementName=PPLGrid}" IsEnabled="False" Style="{StaticResource dashboard_pager_style}" PageSize="30"  
                                                NumericButtonCount="10"   AutoEllipsisMode="Both" IsTotalItemCountFixed="True" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>

 

                                                        </Grid>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Pending Patient Action ends-->
                                        <!--Canceled Appointments-->
                                        <telerik:RadTileViewItem x:Name="CanceledAppointmentsSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect ShadowDepth="1" Opacity="0.7"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Canceled Appointments" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
           State="{Binding ElementName=CanceledAppointmentsSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="Canceled Appointments Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="CanceledGrid" Grid.Row="0" BorderThickness="0" RowIndicatorVisibility="Collapsed" ItemsSource="{Binding CanceledAppointmentList, Mode=TwoWay}"   AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False" HorizontalAlignment="Left"
                                    Width="auto" MinWidth="326" ShowGroupPanel="False" RowHeight="30" Margin="2,-2,0,-11" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   VerticalAlignment="Center" Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0"  Visibility="{Binding CanceledGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tbCancelAppointments" Text="You currently have no Canceled Appointments." />
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1"  IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=CanceledGrid}" Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>
                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="CNCLGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                        AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"  GridLinesVisibility="None"
                                        HorizontalAlignment="Left" ItemsSource="{Binding CanceledAppointmentList, Mode=TwoWay}"
                                            VerticalAlignment="Top" ShowGroupPanel="False" MinHeight="200" MaxHeight="450">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   VerticalAlignment="Center" Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding CanceledGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock  Text="You currently have no canceled appointment."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="80"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" DisplayMode="PreviousNextNumeric" Grid.Column="1" IsEnabled="False" Source="{Binding Items, ElementName=CNCLGrid}"  PageSize="30" Style="{StaticResource dashboard_pager_style}"
                                                NumericButtonCount="10" AutoEllipsisMode="Both" IsTotalItemCountFixed="True" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>

                                                        </Grid>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Canceled Appointments ends-->
                                        <!--Declined Appointments-->
                                        <telerik:RadTileViewItem x:Name="DeclinedAppointmentsSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Declined Appointments" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=DeclinedAppointmentsSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="Declined Appointments Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="DAGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                        ItemsSource="{Binding DeclinedAppointmentList, Mode=TwoWay}" AlternateRowBackground="AliceBlue"  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                        AlternationCount="2" AutoGenerateColumns="False" HorizontalAlignment="Left" Height="120" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                            Width="auto" MinWidth="326" VerticalAlignment="Top" ShowGroupPanel="False" Margin="2,-2,0,-11" Grid.Row="0" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp" Command="{Binding CmdDeclineThisAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center" Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0"  Visibility="{Binding DAGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tbDeclinedAppointments" Text="You currently have no Declined Appointments."  />
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1"  IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=DAGrid}" Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                        <!--</StackPanel>
                                </ScrollViewer>-->
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>

                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                            </Grid.RowDefinitions>

                                                            <telerik:RadGridView    x:Name="DALGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                                            ItemsSource="{Binding DeclinedAppointmentList, Mode=TwoWay}"  AlternateRowBackground="AliceBlue" AlternationCount="2"
                                                            AutoGenerateColumns="False" HorizontalAlignment="Left" Grid.Row="0"  GridLinesVisibility="None"
                                                            VerticalAlignment="Top" ShowGroupPanel="False" MinHeight="200" MaxHeight="450">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time" MinWidth="90"/>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient" Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider" Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   VerticalAlignment="Center" Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding DAGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock  Text="You currently have no declined appointments."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" DisplayMode="PreviousNextNumeric" Grid.Column="1" IsEnabled="False" Source="{Binding Items, ElementName=myProviderGridView}"  PageSize="30"  
                                                NumericButtonCount="10"   AutoEllipsisMode="Both" IsTotalItemCountFixed="True" Style="{StaticResource dashboard_pager_style}" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>

 

                                                        </Grid>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Declined Appointments ends-->
                                        <!--Wait List-->
                                        <telerik:RadTileViewItem x:Name="WaitListSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Wait List" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=WaitListSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="Wait List Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="WGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                    ItemsSource="{Binding WaitList, Mode=TwoWay}"   AlternateRowBackground="AliceBlue"  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                    AlternationCount="2" AutoGenerateColumns="False" HorizontalAlignment="Left" MinHeight="100" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                    Width="auto" MinWidth="326" VerticalAlignment="Top" ShowGroupPanel="False" Margin="2,-2,0,-11" Grid.Row="0" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>

                                                                                    <telerik:RadButton x:Name="rbRemoveFromWaitListApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.RemoveFromWaitList, Source={StaticResource ResourceWrapper}}"   Command="{Binding CmdRemoveMeFromWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/Remove_me_from_waitlist.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0"  Visibility="{Binding WGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tbWaitList" Text="You currently have no wait list."  />
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1"  IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=WLGrid}" Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                        <!--</StackPanel>
                                </ScrollViewer>-->
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>
                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                            </Grid.RowDefinitions>

                                                            <telerik:RadGridView    x:Name="WLGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed" ItemsSource="{Binding WaitList, Mode=TwoWay}"
                                                        AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False" HorizontalAlignment="Left"
                                                                        GridLinesVisibility="None" VerticalAlignment="Top" ShowGroupPanel="False" MinHeight="200" MaxHeight="450">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding NewAppointmentDate,Mode=OneWay}" Header="Date/Time"  Width="90" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Patient,Mode=OneWay}" Header="Patient"  Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=OneWay}" Header="Provider"  Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <telerik:RadButton  Margin="0,0,0,0" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.ViewAppointmentDetails, Source={StaticResource ResourceWrapper}}" x:Name="rbViewlApp"   Command="{Binding CmdViewAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}" >
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/View_Appointment_details.png"></Image>
                                                                                    </telerik:RadButton>

                                                                                    <telerik:RadButton x:Name="rbRemoveFromWaitListApp" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" ToolTipService.ToolTip="{Binding Path=ApplicationStrings.RemoveFromWaitList, Source={StaticResource ResourceWrapper}}"   Command="{Binding CmdRemoveMeFromWaitList, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                        <Image  Margin="0,0,0,0"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/Remove_me_from_waitlist.png"></Image>

                                                                                    </telerik:RadButton>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>

                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding WGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock  Text="You currently have no wait list."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" DisplayMode="PreviousNextNumeric" Grid.Column="1" IsEnabled="False" Source="{Binding Items, ElementName=WLGrid}"  PageSize="30"  
                                                NumericButtonCount="10"   AutoEllipsisMode="Both" IsTotalItemCountFixed="True" Style="{StaticResource dashboard_pager_style}" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"  NavigateUri="">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>

 

                                                        </Grid>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Wait List ends-->
                                        <!--My Providers-->
                                        <telerik:RadTileViewItem x:Name="MyProvidersSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="My Providers" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=MyProvidersSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="My Providers Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <Grid  Background="#ffffffff">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="88" ></RowDefinition>
                                                                <RowDefinition Height="20" ></RowDefinition>
                                                                <RowDefinition Height="auto" ></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="MPGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                        ItemsSource="{Binding MyProviderList, Mode=TwoWay}"   AlternateRowBackground="AliceBlue"  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                        AlternationCount="2" AutoGenerateColumns="False" HorizontalAlignment="Left" Height="120" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                            Width="auto" MinWidth="326" VerticalAlignment="Top" ShowGroupPanel="False" Margin="2,-2,0,-11" Grid.Row="0" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=TwoWay}" Header="Provider" Width="155" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Phone,Mode=TwoWay}" Header="Phone" Width="120" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="80" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <telerik:RadButton ToolTipService.ToolTip="Book Appointment" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" Command="{Binding CmdBookAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                    <Image  Margin="0,0,0,0"  Height="24" Width="24"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/book_appointment.png"></Image>
                                                                                </telerik:RadButton>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
                                                            <StackPanel Grid.Row="1" Margin="5 -40 5 0"  Visibility="{Binding MPGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock x:Name="tbProviders" Text="You currently have no provider." />
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2" Background="#ffe8eff6">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="90"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>
                                                                    <telerik:RadDataPager BorderThickness="0" Grid.Column="1"  AutoEllipsisMode="Both" IsTotalItemCountFixed="True"  IsEnabled="False" Height="30"  DisplayMode="PreviousNextNumeric"  Source="{Binding Items, ElementName=MPGrid}" Style="{StaticResource dashboard_pager_style}" PageSize="5" HorizontalAlignment="Left" />

       <HyperlinkButton Grid.Column="2"  x:Name="hplViewAllProvider" Click="ViewAll_Click">
    <HyperlinkButton.Content>
        <Canvas>
            <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
             <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
               <GradientStop Color="White" Offset="0"/>
               <GradientStop Color="#FFEAF0F7" Offset="1"/>
              </LinearGradientBrush>
             </Rectangle.Fill>
            </Rectangle>
            <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
        </Canvas>
    </HyperlinkButton.Content>
</HyperlinkButton>

                                                                   
                                                                     
                                                                   
                                                                </Grid>
                                                            </StackPanel>
                                                        </Grid>
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>
                                                        <Grid Height="Auto">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="Auto"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <telerik:RadGridView    x:Name="MPLGrid" BorderThickness="0" RowIndicatorVisibility="Collapsed"
                                        AlternateRowBackground="AliceBlue" AlternationCount="2" AutoGenerateColumns="False"
                                        HorizontalAlignment="Left" MinHeight="200" MaxHeight="450" ItemsSource="{Binding MyProviderList, Mode=TwoWay}"
                                            VerticalAlignment="Top" ShowGroupPanel="False" GridLinesVisibility="None">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Provider,Mode=TwoWay}" Header="Provider" Width="*" />
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Phone,Mode=TwoWay}" Header="Phone" Width="*" />
                                                                    <telerik:GridViewColumn Header="Actions" Width="100" UniqueName="Action">
                                                                        <telerik:GridViewColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <telerik:RadButton ToolTipService.ToolTip="Book Appointment" Style="{StaticResource RadButtonStyle1}" Background="{x:Null}" BorderBrush="{x:Null}" Command="{Binding CmdBookAppointment, Source={StaticResource ViewModel}}"  CommandParameter="{Binding AppointmentId}">
                                                                                    <Image  Margin="0,0,0,0" Height="24" Width="24"  VerticalAlignment="Center"  Source="/OT.Patient;component/Asset/Image/book_appointment.png"></Image>
                                                                                </telerik:RadButton>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewColumn.CellTemplate>
                                                                    </telerik:GridViewColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>

                                                            <StackPanel Grid.Row="1" Margin="5 -100 5 0" Visibility="{Binding MPGridDivMsgVisible, Mode=TwoWay}">
                                                                <TextBlock  Text="You currently have no Confirmed Appointments."></TextBlock>
                                                            </StackPanel>
                                                            <StackPanel Grid.Row="2">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*"/>
                                                                        <ColumnDefinition Width="160"/>
                                                                        <ColumnDefinition Width="75"/>
                                                                    </Grid.ColumnDefinitions>

                                                                    <telerik:RadDataPager BorderThickness="0" DisplayMode="PreviousNextNumeric" Grid.Column="1" IsEnabled="False"  Source="{Binding Items, ElementName=MPLGrid}"  PageSize="30"  
                                                NumericButtonCount="10" Style="{StaticResource dashboard_pager_style}"  AutoEllipsisMode="Both" IsTotalItemCountFixed="True" HorizontalAlignment="Left"/>
                                                                    <HyperlinkButton Grid.Column="2" HorizontalAlignment="Left"   NavigateUri="/Patient/MyProviders">
                                                                        <HyperlinkButton.Content>
                                                                            <Canvas>
                                                                                <Rectangle Width="70" Height="28" Stroke="#FFC8D8E8" RadiusX="15" RadiusY="15" >
                                                                                    <Rectangle.Fill>
                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                            <GradientStop Color="White" Offset="0"/>
                                                                                            <GradientStop Color="#FFEAF0F7" Offset="1"/>
                                                                                        </LinearGradientBrush>
                                                                                    </Rectangle.Fill>
                                                                                </Rectangle>
                                                                                <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="#FF2C5486" Canvas.Left="14" Canvas.Top="7">View all</TextBlock>
                                                                            </Canvas>
                                                                        </HyperlinkButton.Content>
                                                                    </HyperlinkButton>
                                                                </Grid>
                                                            </StackPanel>

 

                                                        </Grid>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--My Providers ends-->
                                        <!--Refer HealthCare Provider-->
                                        <telerik:RadTileViewItem x:Name="ReferHealthCareProviderSeries" BorderThickness="0" Background="#FFE8EFF6">
                                         <telerik:RadTileViewItem.Effect>
                                          <DropShadowEffect Opacity="0.7" ShadowDepth="1"/>
                                         </telerik:RadTileViewItem.Effect>
                                            <telerik:RadTileViewItem.Header>
                                                <TextBlock Text="Refer HealthCare Provider" Style="{StaticResource HeaderTitle}" />
                                            </telerik:RadTileViewItem.Header>
                                            <telerik:RadTileViewItem.Content>
                                                <telerik:RadFluidContentControl ContentChangeMode="Manual" BorderThickness="0"
         State="{Binding ElementName=ReferHealthCareProviderSeries, Path=TileState, Converter={StaticResource myConverter}, Mode=TwoWay}">
                                                    <telerik:RadFluidContentControl.SmallContent>
                                                        <Border Width="230" Height="130">
                                                            <TextBlock Text="Refer HealthCare Provider Group" Style="{StaticResource SmallBox}" />
                                                        </Border>
                                                    </telerik:RadFluidContentControl.SmallContent>
                                                    <telerik:RadFluidContentControl.Content>
                                                        <StackPanel Orientation="Vertical" Margin="0" Background="White">
                                                            <TextBlock Margin="5" Text="{Binding ApplicationStrings.ReferHealthcareProviderBodyText, Source={StaticResource ResourceWrapper}}" />
                                                            <HyperlinkButton Margin="5" Content="{Binding ApplicationStrings.ReferHealthcareProviderLinkText, Source={StaticResource ResourceWrapper}}" Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="ReferHealthCare"     NavigateUri="{Binding ReferHealthCare}" TargetName="ContentFrame"/>

                                                          

                                                        </StackPanel>
                                                    </telerik:RadFluidContentControl.Content>
                                                    <telerik:RadFluidContentControl.LargeContent>
                                                        <StackPanel Orientation="Vertical" Background="White">
                                                            <TextBlock Text="Want to see your Providers on OpenTreatment?" />
                                                            <TextBlock Text="We're happy to invite them to join"/>
                                                            <HyperlinkButton Content="Refer HealthCare Provider"/>
                                                        </StackPanel>
                                                    </telerik:RadFluidContentControl.LargeContent>
                                                </telerik:RadFluidContentControl>
                                            </telerik:RadTileViewItem.Content>
                                        </telerik:RadTileViewItem>
                                        <!--Refer HealthCare Provider ends-->
                                    </telerik:RadTileView>
                                </Border>

                            </StackPanel>

                            <StackPanel Grid.Row="0" Grid.Column="1" Height="auto" Width="250" VerticalAlignment="Top">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"></RowDefinition>
                                        <RowDefinition Height="auto"></RowDefinition>

                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition></ColumnDefinition>
                                    </Grid.ColumnDefinitions>

                                    <StackPanel Grid.Row="0" Margin="0 8 0 12"  Visibility="{Binding ProfileCompletenessVisibility,Mode=TwoWay}">
                                        <Grid x:Name="LayoutRoot2" >
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="auto"/>
                                            </Grid.ColumnDefinitions>

                                            <Path Stretch="Fill" Fill="#FFE8EFF6" Data="F1 M 1246,43.0023L 1462,43.0023C 1467.52,43.0023 1472,47.4794 1472,53.0023L 1472,352.001C 1472,357.524 1467.52,362.001 1462,362.001L 1246,362.001C 1240.47,362.001 1236,357.524 1236,352.001L 1236,53.0023C 1236,47.4794 1240.47,43.0023 1246,43.0023 Z " Margin="0,0,0,0" UseLayoutRounding="False" HorizontalAlignment="Left" Width="248" Height="250">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="0.7"/>
                                                </Path.Effect>
                                            </Path>
                                            <Rectangle Stretch="Fill" Fill="#FFFFFFFF" Margin="8,8,0,0"  HorizontalAlignment="Left" Width="230" Height="235" VerticalAlignment="Top"/>

                                            <StackPanel Grid.Row="0" VerticalAlignment="Top" Margin="0,15,0,0">
                                                <telerik:RadProgressBar x:Name="completnessProgressBar" Value="{Binding ProfielCompleteness, Mode=TwoWay}" Minimum="0" Maximum="4" Width="200" Height="22"  ></telerik:RadProgressBar>

                                                <TextBlock Margin="23,10,0,0" TextWrapping="Wrap" FontFamily="Arial" FontWeight="Bold"
                Foreground="#FF2C5484" HorizontalAlignment="Left" Width="213" Height="auto" Text="{Binding ProfileCompletenessMessage, Mode=TwoWay}"
                VerticalAlignment="Top"></TextBlock>
                                                <TextBlock Margin="23,10,0,0" TextWrapping="Wrap" FontFamily="Arial" FontWeight="Bold"
                Foreground="#FF2C5484" HorizontalAlignment="Left" Width="213" Height="auto"
                VerticalAlignment="Top"><Run FontWeight="Normal" FontSize="12"
                                            Text=""/>
        <Run FontSize="21.333" Text=""/><Run FontWeight="Normal" FontSize="12" Text=""/>
        <LineBreak/><Run FontWeight="Normal" FontSize="12" Text="{Binding ApplicationStrings.ProfileCompletenessMessage, Source={StaticResource ResourceWrapper}}">
      <Run.Foreground>
       <SolidColorBrush Color="#FF767676">
        <SolidColorBrush.RelativeTransform>
         <MatrixTransform Matrix="Identity"/>
        </SolidColorBrush.RelativeTransform>
        <SolidColorBrush.Transform>
         <MatrixTransform Matrix="Identity"/>
        </SolidColorBrush.Transform>
       </SolidColorBrush>
      </Run.Foreground>
     </Run></TextBlock>
                                                <StackPanel Margin="23,10,0,10">
                                                    <Grid>
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="20"/>
                                                            <RowDefinition Height="20"/>
                                                            <RowDefinition Height="20"/>
                                                            <RowDefinition Height="20"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="12"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Image Grid.Column="0" HorizontalAlignment="Left"  x:Name="imgBullets" Width="6" Height="8" Source="/OT.Patient;component/Asset/Image/sml-arrow2.png" />
                                                        <HyperlinkButton Grid.Column="1" x:Name="hlbAccountInformation" FontWeight="Bold"   Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="AccountInformation"     NavigateUri="{Binding AccountInfomation}" TargetName="ContentFrame" Content="{Binding ApplicationStrings.ProfileCompletenessAccountInformation, Source={StaticResource ResourceWrapper}}"/>
                                                        <Image Grid.Row="1" HorizontalAlignment="Left"  Name="imgBullets2" Width="6" Height="8" Source="/OT.Patient;component/Asset/Image/sml-arrow2.png" />
                                                        <HyperlinkButton Grid.Row="1" Grid.Column="1"  x:Name="hlbInsurance"  FontWeight="Bold"    Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="Insurance"     NavigateUri="{Binding AccountInfomation}"   TargetName="ContentFrame" Content="{Binding ApplicationStrings.ProfileCompletenessInsurance, Source={StaticResource ResourceWrapper}}"/>
                                                        <Image Grid.Row="2" HorizontalAlignment="Left"  Name="imgBullets3" Width="6" Height="8" Source="/OT.Patient;component/Asset/Image/sml-arrow2.png" />
                                                        <HyperlinkButton Grid.Row="2" Grid.Column="1" x:Name="hlbMedicalHistory"  FontWeight="Bold"    Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="MedicalHistory"     NavigateUri="{Binding AccountInfomation}"   TargetName="ContentFrame" Content="{Binding ApplicationStrings.ProfileCompletenessMedicalHistory, Source={StaticResource ResourceWrapper}}"/>
                                                        <Image Grid.Row="3" HorizontalAlignment="Left"  Name="imgBullets4" Width="6" Height="8" Source="/OT.Patient;component/Asset/Image/sml-arrow2.png" />
                                                        <HyperlinkButton Grid.Row="3" Grid.Column="1"  x:Name="hlbMyProvider"  FontWeight="Bold"     Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="MyProvider"      TargetName="ContentFrame" Content="{Binding ApplicationStrings.ProfileCompletenessMyProviders, Source={StaticResource ResourceWrapper}}"/>
                                                       
                                                    </Grid>
                                                    </StackPanel>
                                            </StackPanel>
                                        </Grid>

                                    </StackPanel>

                                    <StackPanel Grid.Row="1" Width="250" Margin="0 8 0 0">
                                        <Grid x:Name="LayoutRoot23" >
                                            <Path Stretch="Fill" Fill="#FFE8EFF6" Data="F1 M 1246,43.0023L 1462,43.0023C 1467.52,43.0023 1472,47.4794 1472,53.0023L 1472,352.001C 1472,357.524 1467.52,362.001 1462,362.001L 1246,362.001C 1240.47,362.001 1236,357.524 1236,352.001L 1236,53.0023C 1236,47.4794 1240.47,43.0023 1246,43.0023 Z " UseLayoutRounding="False" HorizontalAlignment="Left" Width="244.998">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="0.7"/>
                                                </Path.Effect>
                                            </Path>
                                            <Rectangle Stretch="Fill" Margin="7,8,0,12" HorizontalAlignment="Left" Width="230">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <LinearGradientBrush.RelativeTransform>
                                                            <CompositeTransform CenterY="0.5" CenterX="0.5" Rotation="17"/>
                                                        </LinearGradientBrush.RelativeTransform>
                                                        <GradientStop Color="White" Offset="0.649"/>
                                                        <GradientStop Color="#FFB6D370"/>
                                                        <GradientStop Color="#FF92CFC0" Offset="0.337"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
<Grid>
 <Grid.RowDefinitions>
  <RowDefinition Height="auto"/>
  <RowDefinition Height="auto"/>
  <RowDefinition Height="auto"/>
  <RowDefinition Height="auto"/>
 </Grid.RowDefinitions>
 <Grid.ColumnDefinitions>
  <ColumnDefinition/>
 </Grid.ColumnDefinitions>
 <TextBlock Margin="18,17,0,0" TextWrapping="Wrap" FontFamily="ITC Avant Garde Std Bk" FontSize="16" FontWeight="Bold" LineHeight="8" Foreground="#FF2C5484" HorizontalAlignment="Left" Width="191" Text="A Note From Open Treatment"/>
<TextBlock Grid.Row="1" Margin="18,10,0,10" TextWrapping="Wrap" FontFamily="ITC Avant Garde Std Bk" FontSize="13.333" FontWeight="Bold" Foreground="#FF2C5484"  HorizontalAlignment="Left" Width="191" Text="For the confirmations on
the go, get text "/>
<TextBlock Grid.Row="2" Margin="18,0,0,0" TextWrapping="Wrap" Foreground="#FF2C5482" HorizontalAlignment="Left" Width="194" VerticalAlignment="Top" FontFamily="Arial" FontSize="10.667"><Run FontWeight="Normal" Text="Some people prefer text messages. If that's you, we can send all your appointment notifications to your cell phone."/>
                                            </TextBlock>
<StackPanel Grid.Row="3" Margin="0,0,0,10" Width="238" HorizontalAlignment="Left">
                                                <Image x:Name="Layer_2" Source="../Asset/Image/dashboard-image.png" Width="237" Height="156" HorizontalAlignment="Left" Margin="7,0,0,0"/>
                                                <HyperlinkButton HorizontalAlignment="Left" Content="{Binding ApplicationStrings.SetYourPreferencesHereContent, Source={StaticResource ResourceWrapper}}" Margin="18,5,0,10"   Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="Preference"   />
                                            </StackPanel>
</Grid>
                                           
                                           
           
                                           

 

                                        </Grid>

                                        <!--<profileCompleteness:PatientDashboardRightBottom x:Name="prtb"></profileCompleteness:PatientDashboardRightBottom>-->
                                        <!--<Grid x:Name="LayoutRootBottom" >
                                            <Path Stretch="Fill" Fill="#FFE8EFF6" Data="F1 M 1246,43.0023L 1462,43.0023C 1467.52,43.0023 1472,47.4794 1472,53.0023L 1472,352.001C 1472,357.524 1467.52,362.001 1462,362.001L 1246,362.001C 1240.47,362.001 1236,357.524 1236,352.001L 1236,53.0023C 1236,47.4794 1240.47,43.0023 1246,43.0023 Z " UseLayoutRounding="False" HorizontalAlignment="Left" Width="244.998">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="0.7"/>
                                                </Path.Effect>
                                            </Path>
                                            <Rectangle Stretch="Fill" Margin="7,8,0,12" HorizontalAlignment="Left" Width="230">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <LinearGradientBrush.RelativeTransform>
                                                            <CompositeTransform CenterY="0.5" CenterX="0.5" Rotation="17"/>
                                                        </LinearGradientBrush.RelativeTransform>
                                                        <GradientStop Color="White" Offset="0.649"/>
                                                        <GradientStop Color="#FFB6D370"/>
                                                        <GradientStop Color="#FF92CFC0" Offset="0.347"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>

                                            <TextBlock Margin="27,8,0,0" TextWrapping="Wrap" FontFamily="Century Gothic" FontSize="16" FontWeight="Bold" LineHeight="8" Foreground="#FF2C5484" Height="60" VerticalAlignment="Top" HorizontalAlignment="Left" Width="191"><Run Text="{Binding ApplicationStrings.ANoteFromOpenTreatmentText, Source={StaticResource ResourceWrapper}}"/></TextBlock>
                                            <TextBlock Margin="29,68,0,0" TextWrapping="Wrap" Foreground="#FF2C5482" HorizontalAlignment="Left" Width="194" Height="100" VerticalAlignment="Top"><Run FontWeight="Bold" FontSize="14.667" FontFamily="Century Gothic" Text="{Binding ApplicationStrings.AllStaffAccountsAreFreeLeftText, Source={StaticResource ResourceWrapper}}"/><LineBreak/><Run FontFamily="Century Gothic" Text="{Binding ApplicationStrings.AllStaffAccountsAreFreeRightText, Source={StaticResource ResourceWrapper}}"/><LineBreak/><Run FontFamily="Century Gothic" Text="{Binding ApplicationStrings.AllStaffAccountsAreFreeMostRightText, Source={StaticResource ResourceWrapper}}"/>
                                            </TextBlock>
                                            <StackPanel Margin="0,0,0,0">
                                                <Image x:Name="Layer_2" Source="../Asset/Image/Layer 1.png" Width="220" Height="80" HorizontalAlignment="Left" Margin="13,170,0,0"/>
                                                <HyperlinkButton HorizontalAlignment="Center" Content="{Binding ApplicationStrings.SetYourPreferencesHereContent, Source={StaticResource ResourceWrapper}}" Margin="0,5,0,0"  Command="{Binding ProfileCompletenessCmd,Source={StaticResource ViewModel}}"  CommandParameter="NavigatePreference"     NavigateUri="{Binding NavigatePreference}" TargetName="ContentFrame"/>
                                            </StackPanel>

 

                                        </Grid>-->
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                    <StackPanel Grid.Row="2" Width="auto"  HorizontalAlignment="Left">

                        <Border CornerRadius="10" BorderThickness="1" BorderBrush="#FF476C90" Padding="1,1,1,8" Margin="8,8,0,0" Width="952">
                            <Border.Effect>
                                <DropShadowEffect Direction="222" Opacity="0.6" ShadowDepth="0" BlurRadius="5"/>
                            </Border.Effect>
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="White" Offset="0"/>
                                    <GradientStop Color="#FFE8EFF6" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border Height="37" CornerRadius="8">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF6AA0BC" Offset="0"/>
                                            <GradientStop Color="#FF005387" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Advanced Provider Search" VerticalAlignment="Center" Margin="10,0,0,0" Foreground="White" FontWeight="Bold"/>

                                </Border>

                                <StackPanel Grid.Row="1" >
                                    <Grid x:Name="LayoutRoot3" Background="Transparent" Margin="10 0">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="auto"/>
                                        </Grid.ColumnDefinitions>

                                        <sdk:TabControl Grid.Row="1" Grid.Column="0" BorderBrush="#FFa3aeb9" Width="930" Padding="6 0 0 15" Margin="0 20 0 0" BorderThickness="1,1,1,1" HorizontalAlignment="Left">
                                            <sdk:TabItem>
                                                <sdk:TabItem.Header>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock>Name</TextBlock>
                                                    </StackPanel>
                                                </sdk:TabItem.Header>
                                                <Grid Margin="6 0 6 0">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto"></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition></ColumnDefinition>
                                                        <ColumnDefinition></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,0,0,1"  Grid.ColumnSpan="2" Margin="0,20,0,10">
                                                        <TextBlock Name="tbFind" Text="Find an appointment by name." Style="{StaticResource green_font}"/>
                                                    </Border>

                                                    <TextBlock Grid.Column="1" FontStyle="Italic" HorizontalAlignment="Right" Name="tbMandatory" VerticalAlignment="Top" Margin="0 25 0 0">Fields marked with <Span Foreground="Red">*</Span> are mandatory.</TextBlock>

                                                    <TextBlock Grid.Row="1" Grid.Column="0"  Name="tbProvider" Style="{StaticResource label_text}">Provider's last name<Span Foreground="Red">*</Span></TextBlock>
                                                    <TextBox  Grid.Row="2" Grid.Column="0" Text="{Binding LastNameToName, Source={StaticResource ViewModel},Mode=TwoWay}" BorderBrush="{Binding ValidateBorderBrush,Source={StaticResource ViewModel},Mode=TwoWay}" Name="txtFirstName" Style="{StaticResource txtbox}"/>

                                                    <TextBlock Grid.Row="1" Grid.Column="1" Style="{StaticResource label_text}" Name="tbProviderLast" Text="Provider's first name"  />
                                                    <TextBox  Grid.Row="2" Grid.Column="1"  Text="{Binding FirstNameToName, Source={StaticResource ViewModel},Mode=TwoWay}" Style="{StaticResource txtbox}" />

                                                    <TextBlock Grid.Row="3" Name="tbPartial" Text="Partial spelling is ok." Margin="0 0 0 20" />
                                                    <TextBlock Grid.Row="4" Style="{StaticResource label_text}" Text="Provider specialty" />

                                                    <ListBox Name="lstSpecialty" Height="150" HorizontalAlignment="Left" Grid.Row="5" ItemsSource="{Binding ProvidersSpecialtiesList}"  SelectionMode="Multiple" DisplayMemberPath="Value" SelectionChanged="lstSpecialty_SelectionChanged" SelectedValue="{Binding SelecteddNameSpecialty,Source={StaticResource ViewModel},Mode=TwoWay}" SelectedValuePath="Key"  VerticalAlignment="Top" Width="320" />

                                                    <CheckBox  Height="60" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left"  IsChecked="{Binding IsCheckName,Source={StaticResource ViewModel},Mode=TwoWay}"  Margin="0,0,0,0" Name="chkSpecialty" VerticalAlignment="Top" >
                                                        <Grid >
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="20*"></RowDefinition>
                                                                <RowDefinition Height="30"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <TextBlock HorizontalAlignment="Left"  FontWeight="Bold" Text="Search only for provider's with this primary specialty." VerticalAlignment="Top" Margin="0,-5,0,0" />
                                                            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" FontStyle="Italic" FontSize="10" VerticalAlignment="Top" Text="While some doctors have many specialties, this search filter helps you find providers based on their primary specialty." Margin="0,10,0,0" Grid.RowSpan="2" />
                                                        </Grid>
                                                    </CheckBox>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="6"  Margin="0,10" Grid.ColumnSpan="2">
                                                    </Border>

                                                    <TextBlock Grid.Row="7" Style="{StaticResource label_text}" Name="tbZip" Text="Zip Code" />
                                                    <TextBox  Grid.Row="8" MaxLength="5" Style="{StaticResource txtbox_sml}" Text="{Binding ZipToName,Source={StaticResource ViewModel},Mode=TwoWay}" Name="txtZip1"/>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="9"  Grid.Column="0" Margin="0,14,20,30">
                                                    </Border>
                                                    <TextBlock Grid.Row="9" HorizontalAlignment="Right" FontWeight="Bold"   Margin="0,5,0,0" Text="OR" VerticalAlignment="Top" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="9"  Grid.Column="1" Margin="0,14,0,30">
                                                    </Border>
                                                    <TextBlock Grid.Row="10" Style="{StaticResource label_text}" Name="tbCity" Text="City" />
                                                    <telerik:RadComboBox Grid.Row="11" Grid.Column="0" HorizontalAlignment="Left" SelectedIndex="0"
                                          VerticalAlignment="Top" Width="320" Style="{StaticResource RadComboBoxStyle}" ItemsSource="{Binding CitiesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedNameCity,Source={StaticResource ViewModel},Mode=TwoWay}" />
                                                    <TextBlock Grid.Row="10" Style="{StaticResource label_text}" Grid.Column="1" Text="State" />
                                                    <telerik:RadComboBox Grid.Row="11" Grid.Column="1" Style="{StaticResource RadComboBoxStyle}" SelectedIndex="0" HorizontalAlignment="Left"
                                          VerticalAlignment="Top" Width="320" ItemsSource="{Binding StatesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedNameState,Source={StaticResource ViewModel}, Mode=TwoWay}" />

                                                    <Grid Grid.Row="13" Grid.ColumnSpan="2" Margin="0 20 0 0">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>

                                                        <Button Style="{StaticResource ButtonStyleNew}" Content="Search"  Command="{Binding NameSearchCommand,Source={StaticResource ViewModel}}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" />

                                                        <Button Content="Cancel" Grid.Column="1" Command="{Binding CancelCommand,Source={StaticResource ViewModel}}" CommandParameter="CancelName" Style="{StaticResource ButtonStyleNew}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" Margin="10 0 0 0" />
                                                    </Grid>

                                                      
                                                </Grid>
                                            </sdk:TabItem>
                                            <sdk:TabItem>
                                                <sdk:TabItem.Header>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock>Specialty</TextBlock>
                                                    </StackPanel>
                                                </sdk:TabItem.Header>
                                                <Grid Margin="6 0 6 0">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto"></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>

                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition></ColumnDefinition>
                                                        <ColumnDefinition></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,0,0,1"  Grid.ColumnSpan="2" Margin="0,20,0,10">
                                                        <TextBlock Width="600" TextWrapping="Wrap" HorizontalAlignment="Left" Text="Find an appointment based on a provider's specialty. Most providers have more than one, so we list their main focus as their primary specialty." Style="{StaticResource green_font}"/>
                                                    </Border>

                                                    <TextBlock Grid.Column="1" HorizontalAlignment="Right" FontStyle="Italic" VerticalAlignment="Top" Margin="0,39,0,0">Fields marked with <Span Foreground="Red">*</Span> are mandatory.</TextBlock>
                                                    <TextBlock  Style="{StaticResource label_text}" Grid.Row="1">Provider specialty (Primary)<Span Foreground="Red">*</Span></TextBlock>
                                                    <TextBlock  Style="{StaticResource label_text}" Grid.Row="1" Grid.Column="1" Text="Provider specialty (Secondary) "  />
                                                    <ListBox Name="lstSpecialtiesPrimary" Height="135" HorizontalAlignment="Left" Grid.Row="2" Margin="0,4,0,0" BorderBrush="{Binding ValidateSpecialtyBorderBrush,Source={StaticResource ViewModel},Mode=TwoWay}" SelectedValue="{Binding SelectedSpecialtyPrimary,Source={StaticResource ViewModel},Mode=TwoWay}" ItemsSource="{Binding ProvidersSpecialtiesPrimary}" DisplayMemberPath="Value" SelectedValuePath="Key"  SelectionChanged="lstSpecialtiesPrimary_SelectionChanged"  SelectionMode="Multiple"   VerticalAlignment="Top" Width="320" />
                                                    <ListBox Name="lstSpecialtiesSecondry"  Height="135" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" ItemsSource="{Binding ProvidersSpecialtiesSecondry}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedSpecialtySecondary,Source={StaticResource ViewModel},Mode=TwoWay}" SelectionChanged="lstSpecialtiesSecondry_SelectionChanged" SelectionMode="Multiple" Margin="0,4,0,0"  VerticalAlignment="Top" Width="300" />
                                                    <TextBlock TextWrapping="Wrap" FontSize="10" FontStyle="Italic" Grid.Row="3" HorizontalAlignment="Left" Margin="0,4,0,0">
                        Every provider lists what they specialize in. While some doctors have many specialties, this search filter helps you find providers based on their primary specialty.
                                                    </TextBlock>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="4"  Margin="0,10" Grid.ColumnSpan="2">
                                                    </Border>
                                                    <TextBlock Style="{StaticResource label_text}" Grid.Row="7" Grid.Column="0" Text="Zip Code" />
                                                    <TextBox  Grid.Row="8" Grid.Column="0" MaxLength="5" Style="{StaticResource txtbox_sml}" Text="{Binding SpecialtyZipCode,Source={StaticResource ViewModel},Mode=TwoWay}" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="9"  Grid.Column="0" Margin="0,14,20,30">
                                                    </Border>
                                                    <TextBlock Grid.Row="9" HorizontalAlignment="Right" FontWeight="Bold"   Margin="0,5,0,0" Text="OR" VerticalAlignment="Top" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="9"  Grid.Column="1" Margin="0,14,0,30">
                                                    </Border>
                                                    <TextBlock  Style="{StaticResource label_text}" Grid.Row="10" Grid.Column="0" Text="City" />

                                                    <telerik:RadComboBox Grid.Row="11" HorizontalAlignment="Left" SelectedIndex="0"
                                          VerticalAlignment="Top" Width="320"  Style="{StaticResource RadComboBoxStyle}"   ItemsSource="{Binding CitiesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedSpecialtyCity,Source={StaticResource ViewModel},Mode=TwoWay}" />

                                                    <TextBlock  Style="{StaticResource label_text}" Grid.Row="10" Grid.Column="1" Text="State" />

                                                    <telerik:RadComboBox Grid.Row="11" Grid.Column="1"  Margin="0,2,0,0"   SelectedIndex="0" HorizontalAlignment="Left"
                                          VerticalAlignment="Top" Width="320" Style="{StaticResource RadComboBoxStyle}"    ItemsSource="{Binding StatesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedSpecialtyState,Source={StaticResource ViewModel}, Mode=TwoWay}" />

                                        <Grid Grid.Row="13" Grid.ColumnSpan="2" Margin="0 20 0 0">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Button Style="{StaticResource ButtonStyleNew}" Content="Search"  Command="{Binding SpecialtySearchCommand,Source={StaticResource ViewModel}}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" />

                                                        <Button Content="Cancel" Grid.Column="1" Command="{Binding CancelCommand,Source={StaticResource ViewModel}}" CommandParameter="CancelSpecialty" Style="{StaticResource ButtonStyleNew}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" Margin="10 0 0 0" />
                                                    </Grid>
                                                   
                                                       
                                                </Grid>
                                            </sdk:TabItem>
                                            <sdk:TabItem>
                                                <sdk:TabItem.Header>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock>Availability</TextBlock>
                                                    </StackPanel>
                                                </sdk:TabItem.Header>
                                                <Grid Margin="6 0 6 0">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto"></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition></ColumnDefinition>
                                                        <ColumnDefinition></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,0,0,1"  Grid.ColumnSpan="2" Margin="0,20,0,10">
                                                        <TextBlock Width="600" TextWrapping="Wrap" HorizontalAlignment="Left" Text="Find an appointment by date and time. Remember: If you search for a specific duration, your results will only show providers who offer appointments for that length of time." Style="{StaticResource green_font}"/>
                                                    </Border>

                                                    <TextBlock Grid.Column="1"  HorizontalAlignment="Right" FontStyle="Italic" VerticalAlignment="Top" Margin="0,39,0,0" Grid.RowSpan="2">Fields marked with <Span Foreground="Red">*</Span> are mandatory.</TextBlock>
                                                    <Grid Grid.Row="1" Grid.ColumnSpan="2">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto" ></RowDefinition>
                                                            <RowDefinition Height="Auto" ></RowDefinition>
                                                            <RowDefinition Height="Auto" ></RowDefinition>
                                                            <RowDefinition Height="Auto" ></RowDefinition>
                                                            <RowDefinition Height="Auto" ></RowDefinition>
                                                            <RowDefinition Height="Auto" ></RowDefinition>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="215"></ColumnDefinition>
                                                            <ColumnDefinition Width="250"></ColumnDefinition>
                                                            <ColumnDefinition></ColumnDefinition>
                                                        </Grid.ColumnDefinitions>
                                                        <TextBlock Style="{StaticResource label_text}">Appointment date<Span Foreground="Red">*</Span></TextBlock>
                                                        <telerik:RadDatePicker  Name="dtPiker" Grid.Row="1"  HorizontalAlignment="Left" SelectedDate="{Binding AppointmentDate,Source={StaticResource ViewModel},Mode=TwoWay}"
                                            BorderBrush="{Binding ValidateAvailabiltyBorderBrush,Source={StaticResource ViewModel},Mode=TwoWay}"  CurrentDateTimeText="{Binding AppointmentDate,Mode=TwoWay}" Width="130" />
                                                        <TextBlock Grid.Column="1" Style="{StaticResource label_text}">Appointment time<Span Foreground="Red">*</Span></TextBlock>
                                                        <telerik:RadTimePicker Name="tmPicker" Width="130" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" SelectedTime="{Binding AppointmentTime,Source={StaticResource ViewModel},Mode=TwoWay}"  BorderBrush="{Binding ValidateAvailabiltyBorderBrush,Source={StaticResource ViewModel},Mode=TwoWay}"></telerik:RadTimePicker>
                                                        <TextBlock Grid.Column="2" Style="{StaticResource label_text}" >Appointment duration (minutes)<Span Foreground="Red">*</Span></TextBlock>
                                                        <telerik:RadComboBox  Grid.Row="1" Grid.Column="2" Style="{StaticResource RadComboBoxStyle}" ItemsSource="{Binding DispalyDurationsData}" SelectedIndex="0" SelectedValue="{Binding AppointmentDuration,Source={StaticResource ViewModel},Mode=TwoWay}" BorderBrush="{Binding ValidateAvailabiltyBorderBrush,Source={StaticResource ViewModel},Mode=TwoWay}" HorizontalAlignment="Left" Width="320" />
                                                    </Grid>

 

 

                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="3"  Margin="0,10" Grid.ColumnSpan="2">
                                                    </Border>

                                                    <TextBlock Grid.Row="4" Style="{StaticResource label_text}" Text="Provider specialty" />
                                                    <ListBox Name="lstAvailability" Height="150" HorizontalAlignment="Left" Grid.Row="5" ItemsSource="{Binding ProvidersSpecialtiesList}"  SelectionMode="Multiple" DisplayMemberPath="Value" SelectionChanged="lstAvailability_SelectionChanged" SelectedValue="{Binding SelectedSpecialtyAvailabilty,Source={StaticResource ViewModel},Mode=TwoWay}" SelectedValuePath="Key"  VerticalAlignment="Top" Width="320" />
                                                    <CheckBox  Height="Auto" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left"   Margin="0,10,0,0" IsChecked="{Binding IsCheckPrmaryAvailability,Source={StaticResource ViewModel},Mode=TwoWay}"   VerticalAlignment="Top" >
                                                        <Grid >
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="50"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <TextBlock  Grid.Row="0" HorizontalAlignment="Left"  FontWeight="Bold"    Text="Search only for provider's with this primary specialty." VerticalAlignment="Top" />
                                                            <TextBlock  Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="10" FontStyle="Italic"     VerticalAlignment="Top" >
                            Every provider lists what they specialize in. While some doctors have many specialties, this search filter helps you find providers based on their primary specialty.</TextBlock>
                                                        </Grid>
                                                    </CheckBox>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="6"  Margin="0,10" Grid.ColumnSpan="2">
                                                    </Border>
                                                    <TextBlock Grid.Row="7" Style="{StaticResource label_text}" Text="Zip Code" />
                                                    <TextBox  Grid.Row="8" MaxLength="5" Style="{StaticResource txtbox_sml}" Text="{Binding AvailabiltyZipCode,Source={StaticResource ViewModel}, Mode=TwoWay}" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="9"  Grid.Column="0" Margin="0,14,20,30">
                                                    </Border>
                                                    <TextBlock Grid.Row="9" HorizontalAlignment="Right" FontWeight="Bold"   Margin="0,5,0,0" Text="OR" VerticalAlignment="Top" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="9"  Grid.Column="1" Margin="0,14,0,30">
                                                    </Border>
                                                    <TextBlock Grid.Row="10" Style="{StaticResource label_text}" Text="City" />
                                                    <!--<TextBox   Grid.Row="11" Grid.Column="0" HorizontalAlignment="Left" Margin="10,3,0,0" Text="{Binding AvailabiltyCity, Mode=TwoWay}" VerticalAlignment="Top" Width="90" />-->
                                                    <telerik:RadComboBox Grid.Row="11" Grid.Column="0" HorizontalAlignment="Left" SelectedIndex="0"
                                         Width="320"  Style="{StaticResource RadComboBoxStyle}"   ItemsSource="{Binding CitiesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding  SelectedAvailabiltyCity,Source={StaticResource ViewModel},Mode=TwoWay}" />

                                                    <TextBlock Grid.Row="10" Grid.Column="1" Style="{StaticResource label_text}" Text="State" />
                                                    <telerik:RadComboBox Grid.Row="11" Grid.Column="1" HorizontalAlignment="Left" Width="320"   SelectedIndex="0"
                                              ItemsSource="{Binding StatesList}" Style="{StaticResource RadComboBoxStyle}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedAvailabiltyState,Source={StaticResource ViewModel}, Mode=TwoWay}" />

                                                    <Grid Grid.Row="13" Grid.ColumnSpan="2" Margin="0 20 0 0">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Button Style="{StaticResource ButtonStyleNew}" Content="Search"  Command="{Binding AvailabiltySearchCommand,Source={StaticResource ViewModel}}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" />

                                                        <Button Content="Cancel" Grid.Column="1" Command="{Binding CancelCommand,Source={StaticResource ViewModel}}" CommandParameter="CancelAvailability" Style="{StaticResource ButtonStyleNew}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" Margin="10 0 0 0" />
                                                    </Grid>
                                                  

                                                </Grid>
                                            </sdk:TabItem>
                                            <sdk:TabItem>
                                                <sdk:TabItem.Header>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock>Proximity</TextBlock>
                                                    </StackPanel>
                                                </sdk:TabItem.Header>
                                                <Grid Margin="6 0 6 0">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition></ColumnDefinition>
                                                        <ColumnDefinition></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,0,0,1"  Grid.ColumnSpan="2" Margin="0,20,0,10">
                                                        <TextBlock Width="600" TextWrapping="Wrap" HorizontalAlignment="Left" Text="Find an appointment by location." Style="{StaticResource green_font}"/>
                                                    </Border>
                                                    <TextBlock Height="Auto" Grid.Column="1" FontStyle="Italic" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,26,0,0" >Fields marked with <Span Foreground="Red">*</Span> are mandatory.</TextBlock>
                                                    <TextBlock Grid.Row="1" Style="{StaticResource label_text}">Zip Code <Span Foreground="Red">*</Span></TextBlock>
                                                    <TextBox Grid.Row="2" Width="90" Style="{StaticResource txtbox_sml}" />
                                                    <TextBlock  Grid.Row="1" Grid.Column="1" Style="{StaticResource label_text}">Distance in miles<Span Foreground="Red">*</Span></TextBlock>
                                                    <TextBox  Grid.Row="2" Grid.Column="1" Style="{StaticResource txtbox_sml}" />

                                                    <TextBlock Grid.Row="3" Margin="0 20 0 6"  Style="{StaticResource label_text}">Provider specialty<Span Foreground="Red">*</Span></TextBlock>
                                                    <ListBox Height="150" HorizontalAlignment="Left" Grid.Row="4" ItemsSource="{Binding ProvidersSpecialtiesList}" DisplayMemberPath="Value" SelectedValuePath="{Binding value}"  Width="320" />
                                                    <CheckBox  Height="Auto" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" >
                                                        <Grid >
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="50"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <TextBlock  Grid.Row="0" HorizontalAlignment="Left"  FontWeight="Bold"    Text="Search only for provider's with this primary specialty." VerticalAlignment="Top" />
                                                            <TextBlock  Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="10" FontStyle="Italic"     VerticalAlignment="Top" >
                            Every provider lists what they specialize in. While some doctors have many specialties, this search filter helps you find providers based on their primary specialty.</TextBlock>
                                                        </Grid>
                                                    </CheckBox>
                                            <Grid Grid.Row="13" Grid.ColumnSpan="2" Margin="0 20 0 0">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Button Style="{StaticResource ButtonStyleNew}" Content="Search"  Command="{Binding ProximitySearchCommand}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" />
                                                        <Button Content="Cancel" Grid.Column="1" Command="{Binding CancelCommand,Source={StaticResource ViewModel}}" CommandParameter="CancelProximity" Style="{StaticResource ButtonStyleNew}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" Margin="10 0 0 0" />
                                                    </Grid>                                                          

                                                </Grid>
                                            </sdk:TabItem>
                                            <sdk:TabItem>
                                                <sdk:TabItem.Header>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock>Insurance</TextBlock>
                                                    </StackPanel>
                                                </sdk:TabItem.Header>
                                                <Grid Margin="6 0 6 0">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                        <RowDefinition Height="Auto" ></RowDefinition>
                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition></ColumnDefinition>
                                                        <ColumnDefinition></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,0,0,1"  Grid.ColumnSpan="2" Margin="0,20,0,10">
                                                        <TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" Text="Find an appointment based on who accepts your insurance." Style="{StaticResource green_font}"/>
                                                    </Border>

                                                    <TextBlock Grid.Column="1"  HorizontalAlignment="Right" FontStyle="Italic" VerticalAlignment="Top" Margin="0,25,0,0">Fields marked with <Span Foreground="Red">*</Span> are mandatory.</TextBlock>
                                                    <TextBlock Grid.Row="1" Style="{StaticResource label_text}">Insurance Company<Span Foreground="Red">*</Span></TextBlock>
                                                    <telerik:RadComboBox  Grid.Row="2" Width="320" HorizontalAlignment="Left" Style="{StaticResource RadComboBoxStyle}" />

                                                    <TextBlock  Grid.Row="3" Margin="0 15 0 6" Style="{StaticResource label_text}">Provider specialty<Span Foreground="Red">*</Span></TextBlock>
                                                    <ListBox Height="150" HorizontalAlignment="Left" Grid.Row="4" ItemsSource="{Binding ProvidersSpecialtiesList}" DisplayMemberPath="Value" SelectedValuePath="Key" Width="320" />
                                                    <CheckBox  Height="50" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" >
                                                        <Grid >
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="20"></RowDefinition>
                                                                <RowDefinition Height="70"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <TextBlock  Grid.Row="0" HorizontalAlignment="Left"  FontWeight="Bold"    Text="Search only for provider's with this primary specialty." VerticalAlignment="Top" />
                                                            <TextBlock  Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="10" FontStyle="Italic"     VerticalAlignment="Top" >
                            Every provider lists what they specialize in. While some doctors have many specialties, this search filter helps you find providers based on their primary specialty.</TextBlock>
                                                        </Grid>
                                                    </CheckBox>

                                                    <TextBlock Grid.Row="5" Margin="0 15 0 6" Style="{StaticResource label_text}" Text="Zip Code" />
                                                    <TextBox  Grid.Row="6" MaxLength="5" Style="{StaticResource txtbox_sml}" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="7"  Grid.Column="0" Margin="0,14,20,30">
                                                    </Border>
                                                    <TextBlock Grid.Row="7" HorizontalAlignment="Right" FontWeight="Bold"   Margin="0,5,0,0" Text="OR" VerticalAlignment="Top" />
                                                    <Border Height="auto" BorderBrush="#FF96C647" BorderThickness="0,1,0,0" Grid.Row="7"  Grid.Column="1" Margin="0,14,0,30">
                                                    </Border>

                                                    <TextBlock Grid.Row="8" Style="{StaticResource label_text}" Text="City" />

                                                    <telerik:RadComboBox Grid.Row="9" Grid.Column="0" HorizontalAlignment="Left" SelectedIndex="0"
                                          VerticalAlignment="Top" Width="320" Style="{StaticResource RadComboBoxStyle}" ItemsSource="{Binding CitiesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding  SelectedInsuranceCity,Source={StaticResource ViewModel},Mode=TwoWay}" />

                                                    <TextBlock Grid.Row="8" Grid.Column="1" Style="{StaticResource label_text}" Text="State"  />
                                                    <telerik:RadComboBox Grid.Row="9" Grid.Column="1" SelectedIndex="0" HorizontalAlignment="Left"
                                          VerticalAlignment="Top" Width="320" Style="{StaticResource RadComboBoxStyle}"    ItemsSource="{Binding StatesList}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding SelectedInsuranceState,Source={StaticResource ViewModel}, Mode=TwoWay}" />

                                                    <Grid Grid.Row="13" Grid.ColumnSpan="2" Margin="0 20 0 0">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="Auto"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Button Style="{StaticResource ButtonStyleNew}" Content="Search"  Command="{Binding InsuranceSearchCommand}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" />
                                                        <Button Content="Cancel" Grid.Column="1" Command="{Binding CancelCommand,Source={StaticResource ViewModel}}" CommandParameter="CancelInsurence" Style="{StaticResource ButtonStyleNew}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" Margin="10 0 0 0" />
                                                    </Grid>
                                                   
                                                   
                                                </Grid>
                                            </sdk:TabItem>
                                        </sdk:TabControl>
                                    </Grid>

                                </StackPanel>
                            </Grid>
                        </Border>

                    </StackPanel>
                </Grid>
            </StackPanel>

            <StackPanel Grid.Row="1" Background="White" Visibility="{Binding ShowAppointmentDetails,Source={StaticResource ViewModel},Mode=OneWay}" >
            <!--<StackPanel Grid.Row="1" Visibility="Collapsed" Background="White" >-->
              
                    <Grid x:Name="LayoutRootMP" Margin="10">                      
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>                               
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>                               
                            </Grid.ColumnDefinitions>
                            <StackPanel x:Name="stpNonActivePatient" >
                            <Border Grid.ColumnSpan="2" Style="{StaticResource blueborder}">
                                <TextBlock Text="Cancel Appointment" Style="{StaticResource HeaderTitleBlue}" />
                            </Border>

                            <Border Style="{StaticResource greenborder}">
                                <TextBlock Text="AppointmentTypeName" Style="{StaticResource green_font}" />
                            </Border>
                           
                            <StackPanel>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto" />
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>

                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"/>
                                        <ColumnDefinition Width="180"/>
                                        <ColumnDefinition Width="130"/>
                                        <ColumnDefinition Width="180"/>
                                        <ColumnDefinition Width="180"/>
                                        <ColumnDefinition Width="180"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Text="Patient:" Grid.Row="0" Grid.Column="0" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock Name="txtPatient" Grid.Row="0" Grid.Column="1" Margin="0 6 20 0" />
                                    <TextBlock Text="Provider specialty:" Grid.Row="0" Grid.Column="2" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                <TextBlock Name="txtPatientSpecialty"  Grid.Row="0" Grid.Column="3" Margin="0 6 20 0"/>
                                    <TextBlock Text="Checked-in status:" Grid.Row="0" Grid.Column="4" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  x:Name="txtCheckinStatus"  Grid.Row="0" Grid.Column="5" Margin="0 6 20 0"/>

                                    <TextBlock Text="Date of birth:" Grid.Row="1" Grid.Column="0" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtDateOfBirth"  Grid.Row="1" Grid.Column="1" Margin="0 6 20 0"/>
                                    <TextBlock Text="Insurance:" Grid.Row="1" Grid.Column="2" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtInsurance"  Grid.Row="1" Grid.Column="3" Margin="0 6 20 0"/>
                                    <TextBlock Text="Reason for visit:" Grid.Row="1" Grid.Column="4" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtVisit"  Grid.Row="1" Grid.Column="5" Margin="0 6 20 0"/>

                                    <TextBlock Text="Age:" Grid.Row="2" Grid.Column="0" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtAge"  Grid.Row="2" Grid.Column="1" Margin="0 6 20 0"/>
                                    <TextBlock Text="Referred by:" Grid.Row="2" Grid.Column="2" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtRefered"  Grid.Row="2" Grid.Column="3" Margin="0 6 20 0"/>
                                    <TextBlock Text="Appointment date:" Grid.Row="2" Grid.Column="4" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtAppointMentDate"  Grid.Row="2" Grid.Column="5" Margin="0 6 20 0"/>

                                    <TextBlock Text="Phone:" Grid.Row="3" Grid.Column="0" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtPhone"  Grid.Row="3" Grid.Column="1" Margin="0 6 20 0"/>
                                    <TextBlock Text="Appointment time:" Grid.Row="3" Grid.Column="2" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtAppointMentTime"  Grid.Row="3" Grid.Column="3" Margin="0 6 20 0"/>
                                    <TextBlock Text="Appointment duration:" Grid.Row="3" Grid.Column="4" Style="{StaticResource label_text}" Margin="0 6 0 0" />
                                    <TextBlock  Name="txtAppointmentDuration" Grid.Row="3" Grid.Column="5" Margin="0 6 20 0"/>

                                    <TextBlock Text="New patient:" Grid.Row="4" Grid.Column="0" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtNewPatient" Grid.Row="4" Grid.Column="1" Margin="0 6 20 0"/>
                                    <TextBlock Text="Wait list:" Grid.Row="4" Grid.Column="2" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtWaitList"  Grid.Row="4" Grid.Column="3" Margin="0 6 20 0"/>
                                    <TextBlock Text="Insurance verification status:" Grid.Row="4" Grid.Column="4" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  Name="txtInsuranceverificationStatus"  Grid.Row="4" Grid.Column="5" Margin="0 6 20 0"/>
                                </Grid>
                                <StackPanel Margin="0,10,0,0">
                                    <TextBlock Text="Note to the provider:" Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  x:Name="txtNoteToProvider" Margin="0 6 0 0"/>
                                    <TextBlock Text="Comments from the provider:"  Style="{StaticResource label_text}" Margin="0 6 0 0"/>
                                    <TextBlock  x:Name="txtCommentformProvider" Margin="0 6 0 0"/>
                                </StackPanel>
                                <StackPanel Margin="0 30 0 0">
                                    <TextBlock x:Name="txtReasonFor" Text="Reason for cancellation"  Style="{StaticResource label_text}"/>
                                </StackPanel>

                                <StackPanel>
                                    <TextBox Width="700" Height="100" HorizontalAlignment="Left"  />
                                </StackPanel>
                            <Grid Grid.Row="12" Margin="0 20 0 0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <Button Style="{StaticResource ButtonStyleNew}" x:Name="rbnSubmit"   Command="{Binding CmdUpdateAppointment, Source={StaticResource ViewModel}}" Content="Submit" CommandParameter="SUBMIT" HorizontalAlignment="Left" Width="94" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" />

                                <Button Grid.Column="1" x:Name="rbnCancel"  Content="Cancel"  Command="{Binding CmdUpdateAppointment, Source={StaticResource ViewModel}}" CommandParameter="CANCEL" Style="{StaticResource ButtonStyleNew}" HorizontalAlignment="Left" Width="84" Height="30" Foreground="White" Cursor="Hand" FontFamily="ITC Avant Garde Std Bk" FontWeight="Bold" FontSize="12" Margin="10 0 0 0" />
                            </Grid>
                        </StackPanel>
                         
                        </StackPanel>
                        <StackPanel Grid.Row="1">
                            <TextBox x:Name="txtCommand" Visibility="Collapsed"   ></TextBox>
                        </StackPanel>

                    </Grid>
              

 

            </StackPanel>
        </Grid>
    </ScrollViewer>
</UserControl>

_________________________________________________________

2. The converter file that is used..
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using Telerik.Windows.Controls;

namespace OT.Patient
{
    public class FluidContentStateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            TileViewItemState contentState = (TileViewItemState)value;
            switch (contentState)
            {
                case TileViewItemState.Minimized:
                    return FluidContentControlState.Small;
                case TileViewItemState.Restored:
                    return FluidContentControlState.Normal;
                case TileViewItemState.Maximized:
                    return FluidContentControlState.Large;
                default:
                    return FluidContentControlState.Normal;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            FluidContentControlState fluidState = (FluidContentControlState)value;
            switch (fluidState)
            {
                case FluidContentControlState.Small:
                    return TileViewItemState.Minimized;
                case FluidContentControlState.Normal:
                    return TileViewItemState.Restored;
                case FluidContentControlState.Large:
                    return TileViewItemState.Maximized;
                default:
                    return TileViewItemState.Restored;
            }
        }
    }
}

-------------------------------------------------------------------------------------------------
3. The CodeBehind is
using System.ComponentModel.Composition;
using System.Windows.Controls;
using OT.Patient.ViewModel;
using System.Windows.Resources;
using System.IO;
using System.Collections.Generic;
using OT.Patient.Utility;
using OT.Core.Utility;
using System.Windows.Browser;
using System;

using System.Windows;

namespace OT.Patient.View
{
  [Export(typeof(DashboardView))]
  [PartCreationPolicy(CreationPolicy.NonShared)]
  public partial class DashboardView : UserControl
  {
    public DashboardView()
    {
      InitializeComponent();
   
    
               
    }
    [Import]
    public DashboardViewModel ViewModel
    {
      get { return this.DataContext as DashboardViewModel; }
      set { this.DataContext = value; }
    }

    #region AdvanceSearh
    private void lstAvailability_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        //Updated.
        if (lstAvailability.SelectedIndex != -1)
        {
            foreach (var item in lstAvailability.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SpecialtyToName = DashboardViewModel.SpecialtyToName + "," + Keyitem.Value;

            }

        }
    }

    private void lstSpecialtiesPrimary_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (lstSpecialtiesPrimary.SelectedIndex != -1)
        {
            foreach (var item in lstSpecialtiesPrimary.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SelectedPrimaryList = DashboardViewModel.SelectedPrimaryList + "," + Keyitem.Value;

            }

        }
    }

    private void lstSpecialtiesSecondry_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (lstSpecialtiesSecondry.SelectedIndex != -1)
        {
            foreach (var item in lstSpecialtiesSecondry.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SelectedSecondryList = DashboardViewModel.SelectedSecondryList + "," + Keyitem.Value;

            }

        }
    }

    private void lstSpecialty_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (lstSpecialty.SelectedIndex != -1)
        {
            foreach (var item in lstSpecialty.SelectedItems)
            {
                KeyValuePair<string, string> Keyitem = (System.Collections.Generic.KeyValuePair<string, string>)(item);
                DashboardViewModel.SpecialtyToName = DashboardViewModel.SpecialtyToName + "," + Keyitem.Value;

            }

        }

    }
   
    #endregion

    bool gridClick = false;
    string type = string.Empty;
    private void CAGrid_LostFocus(object sender, System.Windows.RoutedEventArgs e)
    {
        //gridClick = true;
        //ShowPopup();
    }

    private void CAGrid_DataError(object sender, Telerik.Windows.Controls.GridView.DataErrorEventArgs e)
    {
     
    }

    private void ViewAll_Click(object sender, System.Windows.RoutedEventArgs e)
    {
        MyApplicationData applicationData = MyApplicationData.GetInstace();
        HyperlinkButton hplViewAll = (HyperlinkButton)sender;

        if (hplViewAll.Name == "hplViewAllProvider")
        {
            if (LoginUser.IsActivate)
            {
                HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/MyProviders", UriKind.Relative));
            }
            else
            {
              
            }
        }

       //

    }

  

 

  }

}

__________________________________________________________________________________________
4. The view model.

using System;
using System.ComponentModel;
using System.Linq;
using System.ComponentModel.Composition;
using Microsoft.Practices.Prism.Regions;
using OT.Core.Utility;
using OT.Patient.Web.Domain;
using OT.Patient.Web.Service;
using System.ServiceModel.DomainServices.Client;
using System.Collections.ObjectModel;
using OT.Patient.Utility;
using System.Windows.Browser;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
using System.Windows;
using OT.Patient.View;
using OT.Patient.Asset.Resource;
using OT.Patient.Web.Service;
using System.IO;
using System.Xml;
using System.Windows.Documents;
using System.Windows.Markup;
using System.Collections.Generic;

namespace OT.Patient.ViewModel
{
    [Export]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class DashboardViewModel : ViewModelBase, IPageTitle
    {
        #region Declarations

        private static string operationType;
        //private static DashboardViewModel _dashboardViewModel;
        //public static DashboardViewModel DashboardVM
        //{
        //    get { return _dashboardViewModel; }
        //    set { _dashboardViewModel = value; }
        //}
        public static  DashboardViewModel DashboardVM { get; set; }

        WaitWindow WaitProgress = new WaitWindow();
        IRegionManager _regionManager;
        SessionServiceClient client;
        // private static DashBoardContext Context;
        private static bool IsAccountActivate;
        private static bool isWaitWindowsRuning;
        private static bool HasInsurance;
        private static bool HasMedicalHistory;
        private static bool HasMyFavoritesList;
        private List<DashBoardAppointment> currAppointmentList;
        private Visibility _divMsgVisible = Visibility.Collapsed;
      
        public int CurrentAppointmentStatus { get; set; }
        public int UpdatedAppointmentStatus { get; set; }
        public int CurrentAppointmentId { get; set; }
        public string OperationType { get; set; }

        private static ObservableCollection<DashBoardAppointment> allAppoinmentList;

        public ObservableCollection<DashBoardAppointment> AllAppoinmentList
        {
            get { return DashboardViewModel.allAppoinmentList; }
            set { DashboardViewModel.allAppoinmentList = value; OnPropertyChanged("AllAppoinmentList"); }
        }

        private DashBoardAppointment currentAppointment;

        private static bool hasFilledAccountInformation;
        public Visibility DivMsgVisible
        {
            get { return _divMsgVisible; }
            set { _divMsgVisible = value; }
        }

        private Visibility _profileCompletenessVisibility;

        public Visibility ProfileCompletenessVisibility
        {
            get { return _profileCompletenessVisibility; }
            set { _profileCompletenessVisibility = value; OnPropertyChanged("ProfileCompletenessVisibility"); }
        }

 

        private Visibility _cAGridDivMsgVisible;

        public Visibility CAGridDivMsgVisible
        {
            get { return _cAGridDivMsgVisible; }
            set { _cAGridDivMsgVisible = value; OnPropertyChanged("CAGridDivMsgVisible"); }
        }
        private Visibility _pOGridDivMsgVisible;

        public Visibility POGridDivMsgVisible
        {
            get { return _pOGridDivMsgVisible; }
            set { _pOGridDivMsgVisible = value; OnPropertyChanged("POGridDivMsgVisible"); }
        }
        private Visibility _pPGridDivMsgVisible;

        public Visibility PPGridDivMsgVisible
        {
            get { return _pPGridDivMsgVisible; }
            set { _pPGridDivMsgVisible = value; OnPropertyChanged("PPGridDivMsgVisible"); }
        }
        private Visibility _canceledGridDivMsgVisible;

        public Visibility CanceledGridDivMsgVisible
        {
            get { return _canceledGridDivMsgVisible; }
            set { _canceledGridDivMsgVisible = value; OnPropertyChanged("CanceledGridDivMsgVisible"); }
        }
        private Visibility _dAGridDivMsgVisible;

        public Visibility DAGridDivMsgVisible
        {
            get { return _dAGridDivMsgVisible; }
            set { _dAGridDivMsgVisible = value; OnPropertyChanged("DAGridDivMsgVisible"); }
        }
        private Visibility _wGridDivMsgVisible;

        public Visibility WGridDivMsgVisible
        {
            get { return _wGridDivMsgVisible; }
            set { _wGridDivMsgVisible = value; OnPropertyChanged("WGridDivMsgVisible"); }
        }
        private Visibility _mPGridDivMsgVisible;

        public Visibility MPGridDivMsgVisible
        {
            get { return _mPGridDivMsgVisible; }
            set { _mPGridDivMsgVisible = value; OnPropertyChanged("MPGridDivMsgVisible"); }
        }

        private string _errorSummaryForeground;
        public string ErrorSummaryForeground
        {
            get { return _errorSummaryForeground; }
            set { _errorSummaryForeground = value; OnPropertyChanged("ErrorSummaryForeground"); }
        }

        private string _errorSummary;
        public string ErrorSummary
        {
            get { return _errorSummary; }
            set { _errorSummary = value; OnPropertyChanged("ErrorSummary"); }
        }

        int appointmentId;
        #endregion Declarations
      
        #region Constructor

        [ImportingConstructor]
        public DashboardViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;
             OnLoad();
        }

        private void OnLoad()
        {
            try
            {
                AllAppoinmentList = new ObservableCollection<DashBoardAppointment>();
                ShowMainDetails = "Visible";
                ShowAppointmentDetails = "Collapsed";
                ProfileCompletenessVisibility = Visibility.Visible;
                hasFilledAccountInformation = false;

                CAGridDivMsgVisible = Visibility.Collapsed;
                POGridDivMsgVisible = Visibility.Collapsed;
                PPGridDivMsgVisible = Visibility.Collapsed;
                CanceledGridDivMsgVisible = Visibility.Collapsed;
                DAGridDivMsgVisible = Visibility.Collapsed;
                WGridDivMsgVisible = Visibility.Collapsed;
                MPGridDivMsgVisible = Visibility.Collapsed;

                isWaitWindowsRuning = true;
                WaitProgress.Show();

                System.Threading.AutoResetEvent autoreset = new System.Threading.AutoResetEvent(false);
                IsAccountActivate = false;
                HasInsurance = false;
                HasMedicalHistory = false;
                HasMyFavoritesList = false;

                if (LoginUser.ID == null || LoginUser.ID == 0)
                {
                    client = new SessionServiceClient();
                    client.GetSessionValueForKeyCompleted += new EventHandler<GetSessionValueForKeyCompletedEventArgs>(Client_GetSessionValueForKeyCompleted);
                    client.GetSessionValueForKeyAsync(Constants.Name);
                    client.GetSessionValueForKeyAsync(Constants.ID);
                    client.GetSessionValueForKeyAsync(Constants.Email);
                }

                //advance search
                ValidateBorderBrush = "Gray";
                ValidateSpecialtyBorderBrush = "Gray";
                ValidateAvailabiltyBorderBrush = "Gray";
                DispalyGridSizeList = new List<string> { "Items per page", "10", "25", "50", "All" };
                this.DispalyGridSizeData = DispalyGridSizeList;
                DispalyDurationList = new List<string> { "15 Minutes", "30 Minutes", "45 Minutes", "1 Hour", "2 Hour", "4 Hour" };
                this.DispalyDurationsData = DispalyDurationList;
                CommonDomainServices Context1 = new CommonDomainServices();
                var QuerySpeciality = Context1.GetVw_multilanguageDropdownDataQuery();
                Context1.Load(QuerySpeciality, LoadBehavior.RefreshCurrent, MyCallBackup, null);
                var QueryStates = Context1.GetVw_multilanguageDropdownDataQuery();
                Context1.Load(QueryStates, LoadBehavior.RefreshCurrent, MyStatesCallBackup, null);
            }
            catch (Exception ex)
            {
                if (isWaitWindowsRuning)
                    WaitProgress.Close();
            }
            finally
            {
                if (isWaitWindowsRuning)
                    WaitProgress.Close();
            }

            LastNameToName = string.Empty;
            FirstNameToName = string.Empty;
            ZipToName = string.Empty;
            SpecialtyZipCode = string.Empty;
            AvailabiltyZipCode = string.Empty;
        }
        public DashboardViewModel()
        {
            ValidateBorderBrush = "Gray";
            ValidateAvailabiltyBorderBrush = "Gray";
            ValidateSpecialtyBorderBrush = "Gray";
            this.ProfileCompletenessCmd = new DelegateCommand<string>(ProfileCompletenessCmd_Click);
            this._cmdCancelAppointment = new DelegateCommand<object>(CancelAppointment_Click);
            this._cmdViewAppointment = new DelegateCommand<object>(ViewAppointment_Click);
            this._cmdGetOnWaitList = new DelegateCommand<object>(GetOnWaitList_Click);
            this._cmdViewCalender = new DelegateCommand<object>(ViewCalender_Click);
            this._cmdRemoveMeFromWaitList = new DelegateCommand<object>(RemoveMeFromWaitList_Click);
            this._cmdDeclineThisAppointment = new DelegateCommand<object>(DeclineThisAppointment_Click);
            this._cmdBookAppointment = new DelegateCommand<object>(BookAppointment_Click);
            this._cmdConfirmAppointment = new DelegateCommand<object>(ConfirmAppointment_Click);

            this._cmdUpdateAppointment = new DelegateCommand<object>(CmdUpdateAppointment_Click);  

            this.NavigateNeedHelp = new DelegateCommand<object>(NavigateNeedHelp_Execute);

            //advance serach

            this.NameSearchCommand = new DelegateCommand<object>(NameSearchCommand_Execute);
            this.AvailabiltySearchCommand = new DelegateCommand<object>(AvailabiltySearchCommand_Execute);
            this.SpecialtySearchCommand = new DelegateCommand<object>(SpecialtySearchCommand_Execute);
            this.AddMyProviderCommand = new DelegateCommand<object>(AddMyProviderCommand_Execute);
            this.Navigate = new DelegateCommand<object>(Navigate_Execute);
            this.NavigatePageOffice = new DelegateCommand<object>(NavigatePageOffice_Execute);
            this.ViewCommand = new DelegateCommand<object>(ViewCommand_Execute);
            this.BookAppointMent = new DelegateCommand<object>(BookAppointMent_Execute);
            this.NavigateWebSite = new DelegateCommand<object>(NavigateWebSite_Execute);
            this.CancelCommand = new DelegateCommand<object>(CancelCommand_Execute);

            //end here

            LastNameToName = string.Empty;
            FirstNameToName = string.Empty;
            ZipToName = string.Empty;
            SpecialtyZipCode = string.Empty;
            AvailabiltyZipCode = string.Empty;
        }

        #endregion Constructor

        #region Callback

        private void Client_GetSessionValueForKeyCompleted(object sender, GetSessionValueForKeyCompletedEventArgs e)
        {
            string s = string.Empty;
            if ((null != e.Error) && (!String.IsNullOrEmpty(e.Error.Message)))
            {
            }
            else
            {
                if (null == e.Result)
                {
                    MyApplicationData objMyApplicationData = MyApplicationData.GetInstace();
                    HtmlPage.Window.Navigate(new Uri(MyApplicationData.StaticPagesURL + "LoginError.aspx?NoSession=true&Unused=" + DateTime.Now.Millisecond, UriKind.Absolute));

                }
                else
                {
                    int result;
                    if (int.TryParse(e.Result.ToString(), out result))
                    {
                        LoginUser.ID = Convert.ToInt32(e.Result);

                        DashBoardContext Context = new DashBoardContext();
                        var QueryPC = Context.GetPatientsQuery();
                        Context.Load(QueryPC, LoadBehavior.RefreshCurrent, GetPatientCallBack, null);
                    }
                    else
                    {
                        if (e.Result.ToString().Contains("@"))
                        {
                            LoginUser.Email = e.Result.ToString();
                        }
                        else
                        {
                            LoginUser.Name = e.Result.ToString();
                        }
                    }

 

 

                }
            }
        }

        /// <summary>
        /// This method will bind the appointment list with grid
        /// </summary>
        /// <param name="lo"></param>
        private void PatientAppointmentListCallBack(LoadOperation lo)
        {
            int patientId = LoginUser.ID != null ? LoginUser.ID : 0;
            if (!lo.HasError)
            {
                if (LoginUser.IsActivate)
                {
                    List<vw_PatientAppointmentList> entityList = lo.Entities.Where(i => i is vw_PatientAppointmentList).Cast<vw_PatientAppointmentList>().ToList().Where(t => t.PatientId == patientId).OrderByDescending(t => t.AppointmentId).ToList().Distinct().ToList().OrderByDescending(o=>o.AppointmentId).ToList();
                    AllAppoinmentList = new ObservableCollection<DashBoardAppointment>();
                   
                    foreach (vw_PatientAppointmentList item in entityList)
                    {
                        // Getting recent 5 records.

                        bool addRecord = true;
                        int appStatus = item.AppointmentStatusId;
                        if (AllAppoinmentList != null && AllAppoinmentList.Count >= 5)
                        {
                            List<DashBoardAppointment> existingentityList = AllAppoinmentList.Where(t => t.AppointmentStatusId == appStatus).ToList();
                            if (existingentityList != null && existingentityList.Count >= 5)
                            {
                                addRecord = false;
                            }
                        }

                        if (addRecord)
                        {
                            AllAppoinmentList.Add(
                                                   new DashBoardAppointment
                                                       (
                                                           item.AppointmentId,
                                                           item.AppointmentStatusId,
                                                           item.ProviderId,
                                                           item.PatientId,
                                                           item.NewAppointmentDate,
                                                           item.Patient,
                                                           item.Provider)
                                                   );
                        }
                    }

                    this.ConfirmedAppointmentList = new ObservableCollection<DashBoardAppointment>(AllAppoinmentList.Where(t => t.AppointmentStatusId == Constants.Confirmed));
                    this.OnPropertyChanged("ConfirmedAppointmentList");

                    this.PendingOfficeActionList = new ObservableCollection<DashBoardAppointment>(AllAppoinmentList.Where(t => t.AppointmentStatusId == Constants.PendingOfficeAction));
                    this.OnPropertyChanged("PendingOfficeActionList");

                    this.PendingPatientActionList = new ObservableCollection<DashBoardAppointment>(AllAppoinmentList.Where(t => t.AppointmentStatusId == Constants.PendingPatientActionList));
                    this.OnPropertyChanged("PendingPatientActionList");

                    this.CanceledAppointmentList = new ObservableCollection<DashBoardAppointment>(AllAppoinmentList.Where(t => t.AppointmentStatusId == Constants.Cancelled));
                    this.OnPropertyChanged("CanceledAppointmentList");

                    this.DeclinedAppointmentList = new ObservableCollection<DashBoardAppointment>(AllAppoinmentList.Where(t => t.AppointmentStatusId == Constants.Declined));
                    this.OnPropertyChanged("DeclinedAppointmentList");

                    this.WaitList = new ObservableCollection<DashBoardAppointment>(AllAppoinmentList.Where(t => t.AppointmentStatusId == Constants.WaitList));
                    this.OnPropertyChanged("WaitList");

                    if (ConfirmedAppointmentList != null && ConfirmedAppointmentList.Count == 0)
                        CAGridDivMsgVisible = Visibility.Visible;
                    else
                        CAGridDivMsgVisible = Visibility.Collapsed;

                    if (PendingOfficeActionList != null && PendingOfficeActionList.Count == 0)
                        POGridDivMsgVisible = Visibility.Visible;
                    else
                        POGridDivMsgVisible = Visibility.Collapsed;

                    if (PendingPatientActionList != null && PendingPatientActionList.Count == 0)
                        PPGridDivMsgVisible = Visibility.Visible;
                    else
                        PPGridDivMsgVisible = Visibility.Collapsed;

                    if (CanceledAppointmentList != null && CanceledAppointmentList.Count == 0)
                        CanceledGridDivMsgVisible = Visibility.Visible;
                    else
                        CanceledGridDivMsgVisible = Visibility.Collapsed;

                    if (DeclinedAppointmentList != null && DeclinedAppointmentList.Count == 0)
                        DAGridDivMsgVisible = Visibility.Visible;
                    else
                        DAGridDivMsgVisible = Visibility.Collapsed;

                    if (WaitList != null && WaitList.Count == 0)
                        WGridDivMsgVisible = Visibility.Visible;
                    else
                        WGridDivMsgVisible = Visibility.Collapsed;

 

                    DivMsgVisible = Visibility.Collapsed;
                    this.OnPropertyChanged("DivMsgVisible");
                }
                else
                {
                    CAGridDivMsgVisible = Visibility.Visible;
                    POGridDivMsgVisible = Visibility.Visible;
                    PPGridDivMsgVisible = Visibility.Visible;
                    CanceledGridDivMsgVisible = Visibility.Visible;
                    DAGridDivMsgVisible = Visibility.Visible;
                    WGridDivMsgVisible = Visibility.Visible;
                    MPGridDivMsgVisible = Visibility.Visible;

                    DivMsgVisible = Visibility.Visible;
                    this.OnPropertyChanged("DivMsgVisible");

                }
            }
        }

        /// <summary>
        /// This method will get the favorite privider of the patient.
        /// </summary>
        /// <param name="lo"></param>
        private void MyProviderCallBack(LoadOperation lo)
        {
            OT.Patient.View.DashboardView dsv = new DashboardView();
            int patientId = LoginUser.ID != null ? LoginUser.ID : 0;
            if (!lo.HasError)
            {
                //if (LoginUser.IsActivate)
                //{
                var entityList = lo.Entities.Where(i => i is vw_PatientProviderList).Cast<vw_PatientProviderList>().ToList().Where(t => t.PatientId == patientId).OrderByDescending(t => t.PatientProviderListId);
                this.MyProviderList = new ObservableCollection<vw_PatientProviderList>(entityList);
                this.OnPropertyChanged("MyProviderList");
                // Active and inactive will done from another callback by Shimab.
                if (MyProviderList.Count > 0)
                {
                    HasMyFavoritesList = true;
                    MPGridDivMsgVisible = Visibility.Collapsed;
                }
                else
                {
                    HasMyFavoritesList = false;
                    MPGridDivMsgVisible = Visibility.Visible;
                }
                //}

                if (LoginUser.IsActivate)
                {
                }
                else
                {
                    MPGridDivMsgVisible = Visibility.Visible;
                }
                UpdateProfileCompletnessProgressBar();
            }
        }
        /// <summary>
        /// This method is used to get the profile completeness of current patient
        /// </summary>
        /// <param name="lo"></param>
        private void GetPatientCallBack(LoadOperation lo)
        {
            int patientId = LoginUser.ID != null ? LoginUser.ID : 0;
            if (!lo.HasError)
            {
                var entityList = lo.Entities.Where(i => i is OT.Patient.Web.Domain.Patient).Cast<OT.Patient.Web.Domain.Patient>().ToList();
                OT.Patient.Web.Domain.Patient currentPatient = entityList.Where(t => t.PatientId == patientId).FirstOrDefault();
                if (currentPatient != null)
                {
                    if (!Convert.IsDBNull(currentPatient.IsAccountApprove) && Convert.ToBoolean(currentPatient.IsAccountApprove))
                    {
                        IsPatientApproved = true;
                        LoginUser.IsActivate = true;
                        ProfielCompleteness = 1;
                        this.OnPropertyChanged("ProfielCompleteness");
                        IsAccountActivate = true;
                    }
                    else
                    {
                        LoginUser.IsActivate = false;
                        IsAccountActivate = false;
                    }
                }
                DashBoardContext Context = new DashBoardContext();
                var QueryMyProvider = Context.GetVw_PatientProviderListQuery();
                Context.Load(QueryMyProvider, LoadBehavior.RefreshCurrent, MyProviderCallBack, null);

                var Query = Context.GetVw_PatientAppointmentListQuery();
                Context.Load(Query, LoadBehavior.RefreshCurrent, PatientAppointmentListCallBack, null);

                var queryCoveredByInsQuery = Context.GetPatientCoveredByInsQuery();
                Context.Load(queryCoveredByInsQuery, LoadBehavior.RefreshCurrent, GetPatientInsuranceCallback, null);

                PatientMedicalHistoryDomainContext PatientMedicalHistoryContext = new Web.Service.PatientMedicalHistoryDomainContext();
                var queryPatientMedicalHistory = PatientMedicalHistoryContext.GetPatientMedicalHistoriesQuery();
                PatientMedicalHistoryContext.Load(queryPatientMedicalHistory, LoadBehavior.RefreshCurrent, GetPatientMedicalHistoryCallback, null);
                //var queryPatientMedicalHistory = Context.GetPatientInsurancesQuery();
                //Context.Load(queryPatientMedicalHistory, LoadBehavior.RefreshCurrent, GetPatientMedicalHistoryCallback, null);

                ShowHideKeyMessages();
                UpdateProfileCompletnessProgressBar();

                if (isWaitWindowsRuning)
                    WaitProgress.Close();
            }
        }

        /// <summary>
        /// This method is used to get the insurance availibility of the patient.
        /// </summary>
        /// <param name="lo"></param>
        private void GetPatientInsuranceCallback(LoadOperation lo)
        {
            int patientId = LoginUser.ID != null ? LoginUser.ID : 0;
            if (!lo.HasError)
            {
                var entityList = lo.Entities.Where(i => i is OT.Patient.Web.Domain.PatientCoveredByIn).Cast<OT.Patient.Web.Domain.PatientCoveredByIn>().Where(t => t.PatientId == LoginUser.ID).ToList();

                if (entityList != null && entityList.Count > 0)
                {
                    HasInsurance = true;
                }
                else
                {
                    HasInsurance = false;
                }
                UpdateProfileCompletnessProgressBar();
            }
        }

        /// <summary>
        /// This method is used to get the Medical history availibility of the patient.
        /// </summary>
        /// <param name="lo"></param>
        private void GetPatientMedicalHistoryCallback(LoadOperation lo)
        {
            int patientId = LoginUser.ID != null ? LoginUser.ID : 0;
            if (!lo.HasError)
            {
                var entityList = lo.Entities.Where(i => i is PatientMedicalHistory).Cast<PatientMedicalHistory>().Where(t => t.PatientId == LoginUser.ID).ToList();
                if (entityList != null && entityList.Count > 0)
                {
                    HasMedicalHistory = true;
                }
                else
                {
                    HasMedicalHistory = false;
                }
                UpdateProfileCompletnessProgressBar();
            }
        }

        /// <summary>
        /// Thi method is used to get the profile completness and show in the progress bar.
        /// </summary>
        private void UpdateProfileCompletnessProgressBar()
        {

            DashBoardContext Context = new DashBoardContext();
            var Query = Context.GetVw_GetPatientBasicDetailsByPatientIdQuery();
            // var opMyCallBack = Context.Load(Query, LoadBehavior.RefreshCurrent, MyCallBack, null);

            Context.Load(Context.GetVw_GetPatientBasicDetailsByPatientIdQuery()).Completed += (s, e) =>
            {
                var entityList = Context.vw_GetPatientBasicDetailsByPatientIds.Where(i => i is vw_GetPatientBasicDetailsByPatientId).Cast<vw_GetPatientBasicDetailsByPatientId>().ToList();
                var Patients = entityList.Where(t => t.PatientId == LoginUser.ID).FirstOrDefault();
                this.OnPropertyChanged("Patients");

                if (Patients != null)
                {
                    if (Patients.BirthDate != null && !string.IsNullOrWhiteSpace(Patients.DriverLicense))
                    {
                        ProfileCompltenssWithAccountInformation(true);
                    }
                    else
                    {
                        ProfileCompltenssWithAccountInformation(false);
                    }
                }
                else
                {
                    ProfileCompltenssWithAccountInformation(false);

                }
            };

            // }

            // }
        }

        private void ProfileCompltenssWithAccountInformation(bool hasAccountInformation)
        {
            string ProfileCompletePercentageMessage = ApplicationStrings.ProfileCompletePercentageMessage.ToString().Trim();
            ProfielCompleteness = 0;
            ProfileCompletenessVisibility = Visibility.Visible;

            if (hasAccountInformation)
                ProfielCompleteness = ProfielCompleteness + 1;

            if (HasMyFavoritesList)
                ProfielCompleteness = ProfielCompleteness + 1;
            if (HasInsurance)
                ProfielCompleteness = ProfielCompleteness + 1;
            if (HasMedicalHistory)
                ProfielCompleteness = ProfielCompleteness + 1;

            this.OnPropertyChanged("ProfielCompleteness");

            if (ProfielCompleteness == 0)
            {
                ProfileCompletenessMessage = ProfileCompletePercentageMessage.Replace("Percent", "0%");
            }
            if (ProfielCompleteness == 1)
            {
                ProfileCompletenessMessage = ProfileCompletePercentageMessage.Replace("Percent", "25%");
            }
            else if (ProfielCompleteness == 2)
            {
                ProfileCompletenessMessage = ProfileCompletePercentageMessage.Replace("Percent", "50%");
            }
            else if (ProfielCompleteness == 3)
            {
                ProfileCompletenessMessage = ProfileCompletePercentageMessage.Replace("Percent", "75%");
            }
            else if (ProfielCompleteness == 4)
            {
                ProfileCompletenessMessage = ProfileCompletePercentageMessage.Replace("Percent", "100%");
                ProfileCompletenessVisibility = Visibility.Collapsed;
            }
            this.OnPropertyChanged("ProfileCompletenessMessage");
        }

        private void MyCallBack(LoadOperation lo)
        {

            try
            {
                if (!lo.HasError)
                {
                    var entityList = lo.Entities.Where(i => i is vw_GetPatientBasicDetailsByPatientId).Cast<vw_GetPatientBasicDetailsByPatientId>().ToList();
                    var Patients = entityList.Where(t => t.PatientId == LoginUser.ID).FirstOrDefault();
                    this.OnPropertyChanged("Patients");

                    if (Patients != null)
                    {
                        if (Patients.BirthDate != null && !string.IsNullOrWhiteSpace(Patients.DriverLicense))
                        {
                            hasFilledAccountInformation = true;
                        }
                        else
                        {
                            hasFilledAccountInformation = false;
                        }
                    }
                    else
                    {
                        hasFilledAccountInformation = false;
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }

        #endregion

        #region IPageTitle

        String IPageTitle.PageTitle
        {
            get { return Constants.PATIENT_DASHBOARD; }
        }

        #endregion IPageTitle

        #region Property

        private string _showMainDetails = "Visible";

        public string ShowMainDetails
        {
            get { return _showMainDetails; }
            set { _showMainDetails = value; OnPropertyChanged("ShowMainDetails"); }
        }
        private string _showAppointmentDetails = "Collapsed";

        public string ShowAppointmentDetails
        {
            get { return _showAppointmentDetails; }
            set { _showAppointmentDetails = value; OnPropertyChanged("ShowAppointmentDetails"); }
        }

        private DashBoardAppointment _currAppointment;

        public DashBoardAppointment CurrAppointment
        {
            get { return _currAppointment; }
            set { _currAppointment = value; OnPropertyChanged("CurrAppointment"); }

        }

        private static ObservableCollection<DashBoardAppointment> _confirmedAppointmentList;
        public ObservableCollection<DashBoardAppointment> ConfirmedAppointmentList
        {
            get
            {
                return _confirmedAppointmentList;
            }
            set
            {
                if (_confirmedAppointmentList != value)
                {
                    _confirmedAppointmentList = value;
                    OnPropertyChanged("ConfirmedAppointmentList");
                }
            }
        }

        //private ObservableCollection<DashBoardAppointment> _confirmedAppointmentList;
        //public ObservableCollection<DashBoardAppointment> ConfirmedAppointmentList
        //{
        //    get
        //    {
        //        //return _confirmedAppointmentList;

        //        DashBoardContext dashBoardContext = new DashBoardContext();
        //        var Querycity = dashBoardContext.GetVw_PatientAppointmentListQuery();
        //        dashBoardContext.Load(Querycity, LoadBehavior.RefreshCurrent, l =>
        //        {
        //            if (!l.HasError)
        //            {

        //                var entityList = l.Entities.Where(i => i is DashBoardAppointment).Cast<DashBoardAppointment>().ToList();
        //                entityList = new List<DashBoardAppointment>(entityList.Where(t => t.AppointmentStatusId == Constants.Confirmed));
        //                _confirmedAppointmentList = new ObservableCollection<DashBoardAppointment>();
        //                foreach (var item in entityList)
        //                {
        //                    CurrAppointment = new DashBoardAppointment();
        //                    CurrAppointment.NewAppointmentDate = item.NewAppointmentDate;
        //                    CurrAppointment.Patient = item.Patient;
        //                    CurrAppointment.Provider = item.Provider;
        //                    CurrAppointment.AppointmentId = item.AppointmentId;
        //                    CurrAppointment.AppointmentStatusId = item.AppointmentStatusId;
        //                    _confirmedAppointmentList.Add(CurrAppointment);
        //                }

        //            }
        //            else
        //            {
        //            }

        //        }, null);
        //        return _confirmedAppointmentList;

        //    }
        //    set
        //    {
        //        if (_confirmedAppointmentList != value)
        //        {
        //            _confirmedAppointmentList = value;
        //            OnPropertyChanged("ConfirmedAppointmentList");
        //        }
        //    }
        //}

        // public ObservableCollection<DashBoardAppointment> PendingOfficeActionList { get; set; }
        private static ObservableCollection<DashBoardAppointment> _pendingOfficeActionList;
        public ObservableCollection<DashBoardAppointment> PendingOfficeActionList
        {
            get
            {
                return _pendingOfficeActionList;
            }
            set
            {
                if (_pendingOfficeActionList != value)
                {
                    _pendingOfficeActionList = value;
                    OnPropertyChanged("PendingOfficeActionList");
                }
            }
        }

        // public ObservableCollection<DashBoardAppointment> PendingPatientActionList { get; set; }
        private static ObservableCollection<DashBoardAppointment> _pendingPatientActionList;
        public ObservableCollection<DashBoardAppointment> PendingPatientActionList
        {
            get
            {
                return _pendingPatientActionList;
            }
            set
            {
                if (_pendingPatientActionList != value)
                {
                    _pendingPatientActionList = value;
                    OnPropertyChanged("PendingPatientActionList");
                }
            }
        }

        //public ObservableCollection<DashBoardAppointment> CanceledAppointmentList { get; set; }
        private static ObservableCollection<DashBoardAppointment> _canceledAppointmentList;
        public ObservableCollection<DashBoardAppointment> CanceledAppointmentList
        {
            get
            {
                return _canceledAppointmentList;
            }
            set
            {
                if (_canceledAppointmentList != value)
                {
                    _canceledAppointmentList = value;
                    OnPropertyChanged("CanceledAppointmentList");
                }
            }
        }

        //public ObservableCollection<DashBoardAppointment> DeclinedAppointmentList { get; set; }
        private static ObservableCollection<DashBoardAppointment> _declinedAppointmentList;
        public ObservableCollection<DashBoardAppointment> DeclinedAppointmentList
        {
            get
            {
                return _declinedAppointmentList;
            }
            set
            {
                if (_declinedAppointmentList != value)
                {
                    _declinedAppointmentList = value;
                    OnPropertyChanged("DeclinedAppointmentList");
                }
            }
        }

        //public ObservableCollection<DashBoardAppointment> WaitList { get; set; }
        private static ObservableCollection<DashBoardAppointment> _WaitList;
        public ObservableCollection<DashBoardAppointment> WaitList
        {
            get
            {
                return _WaitList;
            }
            set
            {
                if (_WaitList != value)
                {
                    _WaitList = value;
                    OnPropertyChanged("WaitList");
                }
            }
        }

        //public ObservableCollection<vw_PatientProviderList> MyProviderList { get; set; }
        private static ObservableCollection<vw_PatientProviderList> _myProviderList;
        public ObservableCollection<vw_PatientProviderList> MyProviderList
        {
            get
            {
                return _myProviderList;
            }
            set
            {
                if (_myProviderList != value)
                {
                    _myProviderList = value;
                    OnPropertyChanged("MyProviderList");
                }
            }
        }

        #endregion

        #region Grid Button Comand

        private DelegateCommand<object> _cmdCancelAppointment;
        public DelegateCommand<object> CmdCancelAppointment
        {
            get { return _cmdCancelAppointment; }
            set { _cmdCancelAppointment = value; }
        }

        private DelegateCommand<object> _cmdViewAppointment;
        public DelegateCommand<object> CmdViewAppointment
        {
            get { return _cmdViewAppointment; }
            set { _cmdViewAppointment = value; }
        }

        private DelegateCommand<object> _cmdGetOnWaitList;
        public DelegateCommand<object> CmdGetOnWaitList
        {
            get { return _cmdGetOnWaitList; }
            set { _cmdGetOnWaitList = value; }
        }

        private DelegateCommand<object> _cmdViewCalender;
        public DelegateCommand<object> CmdViewCalender
        {
            get { return _cmdViewCalender; }
            set { _cmdViewCalender = value; }
        }

        private DelegateCommand<object> _cmdRemoveMeFromWaitList;
        public DelegateCommand<object> CmdRemoveMeFromWaitList
        {
            get { return _cmdRemoveMeFromWaitList; }
            set { _cmdRemoveMeFromWaitList = value; }
        }

        private DelegateCommand<object> _cmdDeclineThisAppointment;
        public DelegateCommand<object> CmdDeclineThisAppointment
        {
            get { return _cmdDeclineThisAppointment; }
            set { _cmdDeclineThisAppointment = value; }
        }

        private DelegateCommand<object> _cmdBookAppointment;
        public DelegateCommand<object> CmdBookAppointment
        {
            get { return _cmdBookAppointment; }
            set { _cmdBookAppointment = value; }
        }

        private DelegateCommand<object> _cmdConfirmAppointment;
        public DelegateCommand<object> CmdConfirmAppointment
        {
            get { return _cmdConfirmAppointment; }
            set { _cmdConfirmAppointment = value; }
        }

        /// <summary>
        /// This method is used to Cancel the confirmation appointment.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void CancelAppointment_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            CancelAppointment(appointmentId);
        }

        /// <summary>
        /// This method is used to view the appointment details.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void ViewAppointment_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            ViewAppointmentDetail(appointmentId);
        }

        /// <summary>
        /// This method is used to put the appointment in wait list.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void GetOnWaitList_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            PutAppointmentOnWaitList(appointmentId);
        }

        /// <summary>
        /// This method is used to view the appointment calender.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void ViewCalender_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            ViewAppointmentCalender(appointmentId);
        }

        /// <summary>
        /// This method is used to Remove me for wait list appointment.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void RemoveMeFromWaitList_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            RemoveMeWaitList(appointmentId);
        }

        /// <summary>
        /// This method is used to decline appointment.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void DeclineThisAppointment_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            DeclineAppointment(appointmentId);

        }
        /// <summary>
        /// This method is used to confirm appointment.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void ConfirmAppointment_Click(object obj)
        {
            appointmentId = 0;
            int.TryParse(obj.ToString(), out appointmentId);
            ConfirmAppointment(appointmentId);
        }

        /// <summary>
        /// This method is used to book an appointment.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void BookAppointment_Click(object obj)
        {
            BookMyProvider();
        }

        #endregion

        #region Private Methods

        /// <summary>
        /// This method is used to Cancel the confirmation appointment.
        /// </summary>
        /// <param name="aId"> Appointment that has to be cancel.</param>
        ///
        //private void CancelAppointment(int aId)
        //{
        //    OperationType = "cancel";
        //    DashBoardContext Context = new DashBoardContext();
        //    var query = Context.GetAppointmentsQuery();
        //    Context.Load(query, LoadBehavior.RefreshCurrent, l =>
        //    {
        //        if (!l.HasError)
        //        {
        //            var v = l.Entities.Where(i => i is Appointment).Cast<Appointment>().ToList();
        //            Appointment currentEntity = new Appointment();
        //            currentEntity = v.Where(t => t.AppointmentId == aId).FirstOrDefault();
        //            if (currentEntity != null)
        //            {

        //                CurrentAppointmentId = aId;
        //                CurrentAppointmentStatus = currentEntity.AppointmentStatusId;
        //                UpdatedAppointmentStatus = Constants.Cancelled;
        //                //AppointmentModificationView.DashboardViewModel = this;
        //                DashboardVM = this;
        //                //AppointmentModificationView cw = new AppointmentModificationView(this);
        //                //cw.Show();
        //            }
        //        }
        //    }, null);

        //}

        private void CancelAppointment(int aId)
        {
            AppointmentModificationView cw = new AppointmentModificationView(aId, "cancel",this);
            cw.Show();
        }

        /// <summary>
        /// This method is used to view the appointment details.
        /// </summary>
        /// <param name="aId"> Appointment that has to be view.</param>
        private void ViewAppointmentDetail(int aId)
        {
            //TODO: Property has to be assign for appoinment id in ViewAppointment page.
            // HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/ViewAppointment", UriKind.Relative));
        }

        /// <summary>
        /// This method is used to put the appointment in wait list.
        /// </summary>
        /// <param name="aId"> Appointment that has to be put in the wait list.</param>
        private void PutAppointmentOnWaitList(int aId)
        {
            ErrorSummary = "";
            DashBoardContext Context = new DashBoardContext();
            var query = Context.GetAppointmentsQuery();
            Context.Load(query, LoadBehavior.RefreshCurrent, l =>
            {
                if (!l.HasError)
                {
                    var v = l.Entities.Where(i => i is Appointment).Cast<Appointment>().ToList();
                    Appointment currentEntity = new Appointment();
                    currentEntity = v.Where(t => t.AppointmentId == aId).FirstOrDefault();
                    if (currentEntity != null)
                    {
                        CurrentAppointmentStatus = currentEntity.AppointmentStatusId;
                        UpdatedAppointmentStatus = Constants.WaitList;
                        currentEntity.AppointmentStatusId = Constants.WaitList; // AppointmentStatusId=3 is Wait list Appointment.
                    }
                  
                    Context.SubmitChanges(submitOperation =>
                    {
                        if (submitOperation.HasError)
                        {
                            submitOperation.MarkErrorAsHandled();
                        }
                        else
                        {
                            currentAppointment = AllAppoinmentList.Where(t => t.AppointmentId == aId).FirstOrDefault();
                            UpdateAppoinmentListCollection(currentAppointment, aId, Constants.WaitList);
                            Common.RecordUpdateSleepThread(2);
                            ErrorSummaryForeground = "Green";
                            ErrorSummary = "Your Appointment has putted on wait list.";
                        }
                    }, null);
                }
            }, null);

        }

        private void ReBindAllGrid()
        {
            DashBoardContext Context = new DashBoardContext();
            var Query = Context.GetVw_PatientAppointmentListQuery();
            Context.Load(Query, LoadBehavior.RefreshCurrent, PatientAppointmentListCallBack, null);
        }

        private void OpAppointment_Completed(object sender, EventArgs e)
        {
            DashBoardContext Context = new DashBoardContext();
            var Query = Context.GetVw_PatientAppointmentListQuery();
            Context.Load(Query, LoadBehavior.RefreshCurrent, PatientAppointmentListCallBack, null);
        }

        /// <summary>
        /// This method is used to view the appointment calender.
        /// </summary>
        /// <param name="aId"> Appointment calender that has to be view.</param>
        private void ViewAppointmentCalender(int aId)
        {
            ErrorSummary = "";
            //TODO: Property has to be assign for appoinment id in viewappointmentcalender page.
            //  HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/ViewAppointmentCalender", UriKind.Relative));
        }

        /// <summary>
        /// This method is used to Remove me for wait list appointment.
        /// </summary>
        /// <param name="aId"> Appointment that has to be remove from wait list.</param>
        private void RemoveMeWaitList(int aId)
        {
            ErrorSummary = "";
            DashBoardContext Context = new DashBoardContext();
            var query = Context.GetAppointmentsQuery();
            Context.Load(query, LoadBehavior.RefreshCurrent, l =>
            {
                if (!l.HasError)
                {
                    var v = l.Entities.Where(i => i is Appointment).Cast<Appointment>().ToList();
                    Appointment currentEntity = new Appointment();
                    currentEntity = v.Where(t => t.AppointmentId == aId).FirstOrDefault();
                    if (currentEntity != null)
                    {
                        CurrentAppointmentStatus = currentEntity.AppointmentStatusId;
                        UpdatedAppointmentStatus = Constants.Confirmed;
                        currentEntity.AppointmentStatusId = Constants.Confirmed;
                    }
                    Context.SubmitChanges(submitOperation =>
                    {
                        if (submitOperation.HasError)
                        {
                            submitOperation.MarkErrorAsHandled();
                        }
                        else
                        {
                            currentAppointment = AllAppoinmentList.Where(t => t.AppointmentId == aId).FirstOrDefault();
                            UpdateAppoinmentListCollection(currentAppointment, aId, Constants.Confirmed);
                            Common.RecordUpdateSleepThread(2);
                        }
                    }, null);
                }
            }, null);

          }

        /// <summary>
        /// This method is used to confirm appointment.
        /// </summary>
        /// <param name="aId"> Appointment that has to be confirm.</param>
        private void ConfirmAppointment(int aId)
        {
            ErrorSummary = "";
            DashBoardContext Context = new DashBoardContext();
            var query = Context.GetAppointmentsQuery();
            Context.Load(query, LoadBehavior.RefreshCurrent, l =>
            {
                if (!l.HasError)
                {
                    var v = l.Entities.Where(i => i is Appointment).Cast<Appointment>().ToList();
                    Appointment currentEntity = new Appointment();
                    currentEntity = v.Where(t => t.AppointmentId == aId).FirstOrDefault();
                    if (currentEntity != null)
                    {
                        CurrentAppointmentStatus = currentEntity.AppointmentStatusId;
                        UpdatedAppointmentStatus = Constants.Confirmed;
                        currentEntity.AppointmentStatusId = Constants.Confirmed;
                    }

                    Context.SubmitChanges(submitOperation =>
                    {
                        if (submitOperation.HasError)
                        {
                            submitOperation.MarkErrorAsHandled();
                        }
                        else
                        {
                            currentAppointment = AllAppoinmentList.Where(t => t.AppointmentId == aId).FirstOrDefault();
                            UpdateAppoinmentListCollection(currentAppointment, aId, Constants.Confirmed);
                            Common.RecordUpdateSleepThread(2);
                        }
                    }, null);
                }
            }, null);

        }

        /// <summary>
        /// This method is used to decline appointment.
        /// </summary>
        /// <param name="aId"> Appointment id that has to be declinet.</param>
        ///

        private void DeclineAppointment(int aId)
        {
            ErrorSummary = "";
            AppointmentModificationView cw = new AppointmentModificationView(aId, "decline", this);
            cw.Show();
        }

        /// <summary>
        /// This method is used to book the appointment with provider.
        /// </summary>
        private void BookMyProvider()
        {
            ErrorSummary = "";
            HtmlPage.Window.Navigate(new Uri("OT.Patient.aspx#/MyProviders", UriKind.RelativeOrAbsolute));
        }

        public void UpdateAppoinmentListCollection(DashBoardAppointment currentApp, int aId, int updateStatusId)
        {
            int appointmentToRemove = 0;
            int currStatus = 0;
            DashBoardAppointment vw_PatientAppointmentListToUpdate = new DashBoardAppointment();
            if (currentApp == null)
                return;
            foreach (DashBoardAppointment item in AllAppoinmentList)
            {
                if (item.AppointmentId == aId)
                {
                    currStatus = item.AppointmentStatusId;
                    vw_PatientAppointmentListToUpdate = item;
                }
            }
            // Removing record.
            if (currentApp.AppointmentStatusId == Constants.Confirmed)
            {
                if (_confirmedAppointmentList.Any(t => t.AppointmentId == aId))
                {
                    _confirmedAppointmentList.Remove(currentApp);
                }
            }
            else if (currentApp.AppointmentStatusId == Constants.PendingOfficeAction)
            {
                if (_pendingOfficeActionList.Any(t => t.AppointmentId == aId))
                {
                    _pendingOfficeActionList.Remove(currentApp);
                }
            }
            else if (currentApp.AppointmentStatusId == Constants.Cancelled)
            {
                if (_canceledAppointmentList.Any(t => t.AppointmentId == aId))
                {
                    _canceledAppointmentList.Remove(currentApp);
                }
            }
            else if (currentApp.AppointmentStatusId == Constants.Declined)
            {
                if (_declinedAppointmentList.Any(t => t.AppointmentId == aId))
                {
                    _declinedAppointmentList.Remove(currentApp);
                }
            }
            else if (currentApp.AppointmentStatusId == Constants.WaitList)
            {
                if (_WaitList.Any(t => t.AppointmentId == aId))
                {
                    _WaitList.Remove(currentApp);
                }
            }
            else if (currentApp.AppointmentStatusId == Constants.PendingPatientActionList)
            {
                if (_pendingPatientActionList.Any(t => t.AppointmentId == aId))
                {
                    _pendingPatientActionList.Remove(currentApp);
                }
            }
            else
            {
            }

            //ADDING..
            ErrorSummaryForeground = "Green";
            if (updateStatusId == Constants.Confirmed)
            {
                if (!_confirmedAppointmentList.Any(t => t.AppointmentId == aId))
                {
                     currentApp.AppointmentStatusId = UpdatedAppointmentStatus;
                    _confirmedAppointmentList.Add(currentApp);
                    ErrorSummary = "Your Appointment has confirmed successfully.";
                }
            }
            else if (updateStatusId == Constants.PendingOfficeAction)
            {
                if (!_pendingOfficeActionList.Any(t => t.AppointmentId == aId))
                {
                    currentApp.AppointmentStatusId = UpdatedAppointmentStatus;
                    _pendingOfficeActionList.Add(currentApp);
                    ErrorSummary = "Your Appointment is put on pending office action.";
                }
            }
            else if (updateStatusId == Constants.Cancelled)
            {
                if (!_canceledAppointmentList.Any(t => t.AppointmentId == aId))
                {
                    currentApp.AppointmentStatusId = UpdatedAppointmentStatus;
                    _canceledAppointmentList.Add(currentApp);
                    ErrorSummary = "Your Appointment has canceled successfully.";
                }
            }
            else if (updateStatusId == Constants.Declined)
            {
                if (!_declinedAppointmentList.Any(t => t.AppointmentId == aId))
                {
                    currentApp.AppointmentStatusId = UpdatedAppointmentStatus;
                    _declinedAppointmentList.Add(currentApp);
                    ErrorSummary = "Your Appointment has declined successfully.";
                }
            }
            else if (updateStatusId == Constants.WaitList)
            {
                if (!_WaitList.Any(t => t.AppointmentId == aId))
                {
                    currentApp.AppointmentStatusId = UpdatedAppointmentStatus;
                    _WaitList.Add(currentApp);
                    ErrorSummary = "Your Appointment is put on wait list.";
                }
            }
            else if (updateStatusId == Constants.PendingPatientActionList)
            {
                if (!_pendingPatientActionList.Any(t => t.AppointmentId == aId))
                {
                    currentApp.AppointmentStatusId = UpdatedAppointmentStatus;
                    _pendingPatientActionList.Add(currentApp);
                    ErrorSummary = "Your Appointment is put on pending patient action list.";
                }
            }
            else
            {
            }

            CurrentAppointmentStatus = 0;
            UpdatedAppointmentStatus = 0;
        }

        #endregion

        #region profile completeness

        private static bool _isPatientApproved;

        public static bool IsPatientApproved
        {
            get { return _isPatientApproved; }
            set { _isPatientApproved = value; }
        }

        private static int _profielCompleteness;
        public static int ProfielCompleteness
        {
            get { return _profielCompleteness; }
            set
            {
                _profielCompleteness = value;
            }
        }

        private string _accountInfomation;
        public string AccountInfomation
        {
            get { return _accountInfomation; }
            set
            {
                _accountInfomation = value;
                this.OnPropertyChanged("AccountInfomation");
            }
        }

        private string _insurance;
        public string Insurance
        {
            get { return _insurance; }
            set
            {
                _insurance = value;
                this.OnPropertyChanged("Insurance");
            }
        }
        private string _medicalHistory;
        public string MedicalHistory
        {
            get { return _medicalHistory; }
            set
            {
                _medicalHistory = value;
                this.OnPropertyChanged("MedicalHistory");
            }
        }

        private string _myProvider;
        public string MyProvider
        {
            get { return _myProvider; }
            set
            {
                _myProvider = value;
                this.OnPropertyChanged("MyProvider");
            }
        }

        private string _referHealthCare;
        public string ReferHealthCare
        {
            get { return _referHealthCare; }
            set
            {
                _referHealthCare = value;
                this.OnPropertyChanged("ReferHealthCare");
            }
        }

        private string _navigatePreference;
        public string NavigatePreference
        {
            get { return _navigatePreference; }
            set
            {
                _navigatePreference = value;
                this.OnPropertyChanged("NavigatePreference");
            }
        }

        private string _profileCompletenessMessage;
        public string ProfileCompletenessMessage
        {
            get { return _profileCompletenessMessage; }
            set
            {
                _profileCompletenessMessage = value;
                this.OnPropertyChanged("ProfileCompletenessMessage");
            }
        }

 

        private DelegateCommand<string> _profileCompletenessCmd;
        public DelegateCommand<string> ProfileCompletenessCmd
        {
            get { return _profileCompletenessCmd; }
            private set { _profileCompletenessCmd = value; }
        }
        /// <summary>
        ///This method is used for redirecting to static non silverlight pages.
        /// </summary>
        /// <param name="lnk"> Page name on which it has to be redirect.</param>
        //private void ProfileCompletenessCmd_Click(string lnk)
        //{
        //    Random random = new Random();
        //    switch (lnk)
        //    {
        //        case "AccountInformation":
        //            if (IsPatientApproved)
        //                HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/AccountInformation", UriKind.Relative));
        //            else
        //                ShowNotActiveMessageBox();
        //            break;
        //        case "Insurance":
        //            if (IsPatientApproved)
        //                HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/Insurance", UriKind.Relative));
        //            else
        //                ShowNotActiveMessageBox();
        //            break;
        //        case "MedicalHistory":
        //            if (IsPatientApproved)
        //                HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/MedicalHistory", UriKind.Relative));
        //            else
        //                ShowNotActiveMessageBox();
        //            break;
        //        case "MyProvider":
        //            if (IsPatientApproved)
        //                HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/MyProvider", UriKind.Relative));
        //            else
        //                ShowNotActiveMessageBox();
        //            break;

        //        case "ReferHealthCare":
        //            if (IsPatientApproved)
        //                HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/ReferDoctor", UriKind.Relative));
        //            else
        //                ShowNotActiveMessageBox();
        //            break;

        //        case "NavigatePreference":
        //            if (IsPatientApproved)
        //                HtmlPage.Window.Navigate(new Uri(OT.Patient.Utility.Utilities.UriPreFix + "Patient/Preferences", UriKind.Relative));
        //            else
        //                ShowNotActiveMessageBox();
        //            break;

        //        default:
        //            break;
        //    }

        //}

        private void ProfileCompletenessCmd_Click(string lnk)
        {
            MyApplicationData applicationData = MyApplicationData.GetInstace();
            Random random = new Random();
            switch (lnk)
            {
                case "AccountInformation":
                    if (LoginUser.IsActivate)
                        HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/AccountInformation", UriKind.Relative));
                    else
                        ShowNotActiveMessageBox();
                    break;
                case "Insurance":
                    if (LoginUser.IsActivate)
                        HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/MyInsurancesAddInsurance", UriKind.Relative));
                    else
                        ShowNotActiveMessageBox();
                    break;
                case "MedicalHistory":
                    if (LoginUser.IsActivate)
                        HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/MedicalHistory", UriKind.Relative));
                    else
                        ShowNotActiveMessageBox();
                    break;
                case "MyProvider":
                    if (LoginUser.IsActivate)
                        HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/MyProviders", UriKind.Relative));
                    else
                        ShowNotActiveMessageBox();
                    break;

                case "ReferHealthCare":
                    if (LoginUser.IsActivate)
                        HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/ReferDoctor", UriKind.Relative));
                    else
                        ShowNotActiveMessageBox();
                    break;

                case "Preference":
                    if (LoginUser.IsActivate)
                        HtmlPage.Window.Navigate(new Uri(MyApplicationData.UriPreFix + "Patient/Preferences", UriKind.Relative));
                    else
                        ShowNotActiveMessageBox();
                    break;

 

                default:
                    break;
            }

        }
        private void ShowNotActiveMessageBox()
        {
            CustomMessageBox cmb = new CustomMessageBox(true);
            cmb.Show();

        }
        #endregion

        #region Key Message Section

        #region Property

        private string _keyMessageVisibility;
        public string KeyMessageVisibility
        {
            get { return _keyMessageVisibility; }
            set
            {
                if (_keyMessageVisibility != value)
                {
                    _keyMessageVisibility = value;
                    OnPropertyChanged("KeyMessageVisibility");
                }
            }

        }

        private string _keyMessage;
        public string KeyMessage
        {
            get { return _keyMessage; }
            set
            {
                if (_keyMessage != value)
                {
                    _keyMessage = value;
                    OnPropertyChanged("KeyMessage");
                }
            }
        }

        private string _needHelpLink;
        public string NeedHelpLink
        {
            get { return _needHelpLink; }
            set
            {
                if (_needHelpLink != value)
                {
                    _needHelpLink = value;
                    OnPropertyChanged("NeedHelpLink");
                }
            }
        }

        private void ShowHideKeyMessages()
        {
            CommunicationDomainContext communicationDomainContext = new CommunicationDomainContext();
            var query = communicationDomainContext.GetCommunicationLogsQuery();
            communicationDomainContext.Load(query, LoadBehavior.RefreshCurrent, GetSystemMessageLogCallback, null);
        }

        #region Callback

        /// <summary>
        /// This method is used to show the System message log for patient.
        /// </summary>
        /// <param name="lo"></param>
        private void GetSystemMessageLogCallback(LoadOperation lo)
        {
            int patientId = LoginUser.ID != null ? LoginUser.ID : 0;
            if (!lo.HasError)
            {
                var entityList = lo.Entities.Where(i => i is CommunicationLog).Cast<CommunicationLog>().Where(t => t.PatientId == LoginUser.ID).ToList();
                if (LoginUser.IsActivate)
                {
                    if (entityList.Count > 0)
                    {
                        CommunicationLog latestLog = entityList.OrderBy(t => t.NotificationDate).FirstOrDefault();
                        this.KeyMessage = latestLog.Text != null ? latestLog.Text.ToString() : "";
                        KeyMessageVisibility = "Visible";
                        NeedHelpLink = "";
                    }
                    else
                    {
                        KeyMessageVisibility = "Collapsed";
                    }
                }
                else
                {
                    this.KeyMessage = "You have not confirmed your account via email yet.";
                    NeedHelpLink = "Need Help?";
                    KeyMessageVisibility = "Visible";
                }
            }
        }

        #endregion

        void AppointmentModificationView_Closed(object sender, EventArgs e)
        {
            if (((AppointmentModificationView)(sender)).txtCommand.Text.Length > 0)
            {
                DashBoardContext Context = new DashBoardContext();
                var Query = Context.GetVw_PatientAppointmentListQuery();
                Context.Load(Query, LoadBehavior.RefreshCurrent, PatientAppointmentListCallBack, null);
            }
        }

        #endregion

        #endregion

        #region Command Grid new

        private ICommand saveCommand;
        public ICommand SaveCommand
        {
            get
            {
                return this.saveCommand ?? (this.saveCommand = new DelegateCommand<object>(this.CancelAppointment_Click, this.CanSave));
            }
        }

        private bool CanSave(object o)
        {
            return true;
        }

        #endregion

        #region Update Appointment Popup

        private DelegateCommand<object> _cmdUpdateAppointment;
        public DelegateCommand<object> CmdUpdateAppointment
        {
            get { return _cmdUpdateAppointment; }
            set { _cmdUpdateAppointment = value; }
        }

        /// <summary>
        /// This method is used to confirm appointment.
        /// </summary>
        /// <param name="obj"> Appointment Id</param>
        private void CmdUpdateAppointment_Click(object obj)
        {
            ShowMainDetails = "Visible";
            ShowAppointmentDetails = "Collapsed";
        }

        #endregion

        #region AdvanceSearch
        #region Declarations
        SearchProviderDomainContext Context;
        #region Others Variables
        public DelegateCommand<object> NavigateNeedHelp { get; set; }
        public DelegateCommand<object> NameSearchCommand { get; set; }
        public DelegateCommand<object> AvailabiltySearchCommand { get; set; }
        public DelegateCommand<object> SpecialtySearchCommand { get; set; }
        public DelegateCommand<object> ViewCommand { get; set; }
        public DelegateCommand<object> BookAppointMent { get; set; }
        public DelegateCommand<object> NavigateWebSite { get; set; }
        public DelegateCommand<object> NavigatePageOffice { get; set; }
        SearchProviderDomainContext Context2;
        private int _selectedIndex;
        public OT.Patient.Web.Domain.PatientProviderList PatientProviderList { get; set; }
        #endregion

        #region Specialties Variables
        private static Dictionary<string, string> ProvidersSpecialtiesToName;
        private static Dictionary<string, string> ProvidersSpecialtiesToPrimary;
        private static Dictionary<string, string> ProvidersSpecialtiesToSecondry;
        private Dictionary<string, string> _providersSpecialtiesList;
        private Dictionary<string, string> providersSpecialtiesToPrimary;
        private Dictionary<string, string> providersSpecialtiesToSecondry;

        #endregion

        #region City
        private static Dictionary<string, string> CityList;
        private Dictionary<string, string> citiesList;
        public Dictionary<string, string> CitiesList
        {
            get { return citiesList; }
            set
            {
                citiesList = value;
                OnPropertyChanged("CitiesList");
            }
        }
        #endregion

        #region States Variables

        private static Dictionary<string, string> StateList;
        private bool _isCheckName;
        private Dictionary<string, string> statesList;
        private string _selectedAppointmentDuration;
        #endregion

        #endregion Declarations

        #region Prtoperties

        #region Others
        private DelegateCommand<object> _deleteCommand;

        public DelegateCommand<object> DeleteCommand
        {
            get { return _deleteCommand; }
            set { _deleteCommand = value; }
        }
        private DelegateCommand<object> _navigate;

        public DelegateCommand<object> Navigate
        {
            get { return _navigate; }
            set { _navigate = value; }
        }
        private DelegateCommand<object> _navigateoffice;

        public DelegateCommand<object> NavigateOffice
        {
            get { return _navigateoffice; }
            set { _navigateoffice = value; }
        }
        private DelegateCommand<object> _addMyProviderCommand;

        public DelegateCommand<object> AddMyProviderCommand
        {
            get { return _addMyProviderCommand; }
            set { _addMyProviderCommand = value; }
        }
        private DelegateCommand<object> _cancelCommand;

        public DelegateCommand<object> CancelCommand
        {
            get { return _cancelCommand; }
            set { _cancelCommand = value; }
        }
        //public static string Count { get; set; }
        public static int? ProviderId { get; set; }
        public static int? OfficeId { get; set; }
        // public static ObservableCollection<vw_AdvanceSearch> ResultData { get; set; }
        // public static ObservableCollection<vw_AdvanceSearchSpecialty> SpecialtyResultData { get; set; }
        // public static ObservableCollection<vw_AdvanceSearchAvailabilty> AvailabiltyResultData { get; set; }
        // public static ObservableCollection<vw_providerSpecialty> ResultSpecialityData { get; set; }
        public IEnumerable<string> DispalyDurationsData { get; set; }
        public List<string> DispalyGridSizeList;
        public IEnumerable<string> DispalyGridSizeData { get; set; }
        private string _specialtiesListToName = string.Empty;
        #endregion

        #region Name Properties
        public bool IsCheckName
        {
            get { return _isCheckName; }
            set { _isCheckName = value; OnPropertyChanged("IsCheckName"); }
        }
        public static string SpecialtyToName { get; set; }
        public static string FirstNameToName { get; set; }
        public static string LastNameToNames { get; set; }
        public static string _LastNameToName;
        public static string LastNameToName
        {
            get { return _LastNameToName; }
            set
            {

                //if (string.IsNullOrEmpty(value))
                //{
                //    throw new ValidationException("Last Name is required");
                //}
                _LastNameToName = value;
            }
        }
        private string _validateBorderBrush;

        public string ValidateBorderBrush
        {
            get { return _validateBorderBrush; }
            set
            {
                _validateBorderBrush = value;
                OnPropertyChanged("ValidateBorderBrush");
            }
        }

        private string _validateAvailabiltyBorderBrush;

        public string ValidateAvailabiltyBorderBrush
        {
            get { return _validateAvailabiltyBorderBrush; }
            set
            {
                _validateAvailabiltyBorderBrush = value;
                OnPropertyChanged("ValidateAvailabiltyBorderBrush");
            }
        }

        private string _validateSpecialtyBorderBrush;

        public string ValidateSpecialtyBorderBrush
        {
            get { return _validateSpecialtyBorderBrush; }
            set
            {
                _validateSpecialtyBorderBrush = value;
                OnPropertyChanged("ValidateSpecialtyBorderBrush");
            }
        }

        public static string ZipToName { get; set; }

        public static string CityToName { get; set; }
        public static string StateToName { get; set; }

        #endregion

        #region Specialty Properties
        public static string SelectedPrimaryList { get; set; }
        public static string SelectedSecondryList { get; set; }
        public static string SpecialtyZipCode { get; set; }
        public static string SpecialtyCity { get; set; }
        public bool _isCheckPrmarySpecialty;
        public bool IsCheckPrmarySpecialty
        {
            get { return _isCheckPrmarySpecialty; }
            set { _isCheckPrmarySpecialty = value; }
        }

        #endregion

        #region  Availabilty Properties

        public List<string> DispalyDurationList;

        public bool _isCheckPrmaryAvailability;
        public bool IsCheckPrmaryAvailability
        {
            get { return _isCheckPrmaryAvailability; }
            set { _isCheckPrmaryAvailability = value; OnPropertyChanged("IsCheckPrmaryAvailability"); }
        }
        public static string SpecialtyToAvailabilty { get; set; }

        private Nullable<DateTime> _appointmentDate;
        public Nullable<DateTime> AppointmentDate
        {
            get { return _appointmentDate; }
            set { _appointmentDate = value; OnPropertyChanged("AppointmentDate"); }
        }
        private TimeSpan _appointmentTime;

        public TimeSpan AppointmentTime
        {
            get { return _appointmentTime; }
            set { _appointmentTime = value; OnPropertyChanged("AppointmentTime"); }
        }
        public string SelectedAppointmentDuration
        {
            get { return _selectedAppointmentDuration; }
            set
            {
                _selectedAppointmentDuration = value;
                OnPropertyChanged("SelectedAppointmentDuration");
            }
        }
        public static string AppointmentDuration { get; set; }
        public static string AvailabiltyZipCode { get; set; }
        public static string AvailabiltyCity { get; set; }

        #endregion

        #region   Fill Specialties Properties

        public Dictionary<string, string> ProvidersSpecialtiesList
        {
            get { return _providersSpecialtiesList; }
            set
            {
                _providersSpecialtiesList = value;
                OnPropertyChanged("ProvidersSpecialtiesList");
            }
        }

        public Dictionary<string, string> ProvidersSpecialtiesPrimary
        {
            get { return providersSpecialtiesToPrimary; }
            set
            {
                providersSpecialtiesToPrimary = value;
                OnPropertyChanged("ProvidersSpecialtiesPrimary");
            }
        }
        public Dictionary<string, string> ProvidersSpecialtiesSecondry
        {
            get { return providersSpecialtiesToSecondry; }
            set
            {
                providersSpecialtiesToSecondry = value;
                OnPropertyChanged("ProvidersSpecialtiesSecondry");
            }
        }

        #endregion

        #region Fill State Properties

        #region DictionaryProperties
        public Dictionary<string, string> StatesList
        {
            get { return statesList; }
            set
            {
                statesList = value;
                OnPropertyChanged("StatesList");
            }
        }

        #endregion

        #region Selected City
        public static string SelectedNameCity { get; set; }
        public static string SelectedAvailabiltyCity { get; set; }
        public static string SelectedInsuranceCity { get; set; }
        public static string SelectedSpecialtyCity { get; set; }

        #endregion

        #region Selected State
        public static string SelectedAvailabiltyState { get; set; }
        public static string SelectedInsuranceState { get; set; }
        public static string SelectedSpecialtyState { get; set; }
        public static string SelectedNameState { get; set; }

        public static string _selectedCityName;
        public static string SelectedCityName
        {
            get
            {
                return _selectedCityName;
            }
            set
            {
                _selectedCityName = value;

            }
        }
        private static string _selectedStateName;

        public static string SelectedStateName
        {
            get { return _selectedStateName; }
            set { _selectedStateName = value; }
        }

        #endregion

        #endregion

        #endregion

        #region Commands

        #region Add and ProfileCompleteness
        private void AddMyProviderCommand_Execute(object obj)
        {
            ProviderId = (int)obj;
            int PatientId = LoginUser.ID != null ? LoginUser.ID : 0;
            PatientMedicalHistoryDomainContext Context = new PatientMedicalHistoryDomainContext();
            PatientProviderList = new Web.Domain.PatientProviderList();
            PatientProviderList.PatientId = PatientId;
            PatientProviderList.ProviderId = ProviderId;
            Context.PatientProviderLists.Add(this.PatientProviderList);
            Context.SubmitChanges();

            Uri uri = new Uri("OT.Patient.aspx#/Patient/MyProviders", UriKind.Relative);
            HtmlPage.Window.Navigate(uri);

        }

        #endregion

        #region Link Command

        private void NavigateNeedHelp_Execute(object obj)
        {
            CustomMessageBox objCustom = new CustomMessageBox(false);
            objCustom.Show();

        }

        private void Navigate_Execute(object obj)
        {
            MyProvidersViewModel.ProviderId = null;
            if (obj != null)
                ProviderId = (int)obj;

        }
        private string _selecteddNameSpecialty;

        public string SelecteddNameSpecialty
        {
            get { return _selecteddNameSpecialty; }
            set { _selecteddNameSpecialty = value; OnPropertyChanged("SelecteddNameSpecialty"); }
        }
        private string _selectedSpecialtySecondary;

        public string SelectedSpecialtySecondary
        {
            get { return _selectedSpecialtySecondary; }
            set { _selectedSpecialtySecondary = value; OnPropertyChanged("SelectedSpecialtySecondary"); }
        }
        private string _selectedSpecialtyPrimary;

        public string SelectedSpecialtyPrimary
        {
            get { return _selectedSpecialtyPrimary; }
            set { _selectedSpecialtyPrimary = value; OnPropertyChanged("SelectedSpecialtyPrimary"); }
        }
        private string _selectedSpecialtyAvailabilty;

        public string SelectedSpecialtyAvailabilty
        {
            get { return _selectedSpecialtyAvailabilty; }
            set { _selectedSpecialtyAvailabilty = value; OnPropertyChanged("SelectedSpecialtyAvailabilty"); }
        }

        private void CancelCommand_Execute(object obj)
        {
            if (obj != null)
            {
                string strObj = obj.ToString();
                switch (strObj)
                {
                    case "CancelName":
                        LastNameToName = string.Empty;
                        OnPropertyChanged("LastNameToName");
                        FirstNameToName = string.Empty;
                        OnPropertyChanged("FirstNameToName");
                        ZipToName = string.Empty;
                        OnPropertyChanged("ZipToName");
                        SelectedNameCity = "0";
                        SelectedNameState = "0";
                        SelecteddNameSpecialty = "0";
                        IsCheckName = false;
                        OnPropertyChanged("SelectedNameCity");
                        OnPropertyChanged("SelectedNameState");
                        break;
                    case "CancelSpecialty":
                        SpecialtyZipCode = string.Empty;
                        SelectedSpecialtyState = "0";
                        SelectedSpecialtyCity = "0";
                        SelectedSpecialtySecondary = "0";
                        SelectedSpecialtyPrimary = "0";
                        IsCheckPrmarySpecialty = false;
                        OnPropertyChanged("SpecialtyZipCode");
                        OnPropertyChanged("SelectedSpecialtyState");
                        OnPropertyChanged("SelectedSpecialtyCity");
                        break;
                    case "CancelAvailability":
                        AvailabiltyZipCode = string.Empty;
                        SelectedAvailabiltyState = "0";
                        SelectedAvailabiltyCity = "0";
                        AppointmentDuration = "15 Minutes";
                        AppointmentDate = null;
                        SelectedSpecialtyAvailabilty = "0";
                        IsCheckPrmaryAvailability = false;
                        AppointmentTime = TimeSpan.Zero;
                        OnPropertyChanged("AvailabiltyZipCode");
                        OnPropertyChanged("SelectedAvailabiltyState");
                        OnPropertyChanged("SelectedAvailabiltyCity");
                        OnPropertyChanged("AppointmentDuration");
                        break;
                    default:
                        break;
                }
            }
        }
        private void NavigatePageOffice_Execute(object obj)
        {
            MyProvidersViewModel.OfficeId = null;
            if (obj != null)
            {
                OfficeId = (int)obj;
                Uri uri = new Uri("OT.Patient.aspx#/Patient/OfficeProfile", UriKind.Relative);
                HtmlPage.Window.Navigate(uri);
            }

        }
        private void ViewCommand_Execute(object obj)
        {
            if (obj != null)
                ProviderId = (int)obj;

        }
        private void BookAppointMent_Execute(object obj)
        {
            if (obj != null)
                ProviderId = (int)obj;

        }
        private void NavigateWebSite_Execute(object obj)
        {
            if (obj != null)
            {
                string strUri = "http://www." + obj.ToString();
                Uri uri = new Uri(strUri, UriKind.RelativeOrAbsolute);
                HtmlPage.Window.Navigate(uri, "blank");
            }
        }

        #endregion

        #region Search Name

        private void NameSearchCommand_Execute(object o)
        {
            Context = new SearchProviderDomainContext();
            var QueryCityName = Context.GetCitiesQuery();
            Context.Load(QueryCityName, LoadBehavior.RefreshCurrent, MyQueryCityNameCallBackup, null);
        }
        private void MyQueryCityNameCallBackup(LoadOperation ln)
        {
            int SelectedCity = SelectedNameCity != null ? Convert.ToInt16(SelectedNameCity) : 0;
            if (!ln.HasError)
            {
                if (SelectedCity != 0)
                {
                    var entityCityList = ln.Entities.Where(i => i is OT.Patient.Web.Domain.City).Cast<OT.Patient.Web.Domain.City>().ToList();
                    entityCityList = entityCityList.Where(t => t.CityId == SelectedCity).ToList();
                    SelectedCityName = entityCityList[0].Name;
                }
                DashBoardContext Context = new DashBoardContext();
                var QueryStateName = Context.GetStatesQuery();
                Context.Load(QueryStateName, LoadBehavior.RefreshCurrent, MyQueryStateNameCallBackup, null);
            }
        }
        private void MyQueryStateNameCallBackup(LoadOperation ln)
        {
            int SelectedStateId = SelectedNameState != null ? Convert.ToInt16(SelectedNameState) : 0;
            if (!ln.HasError)
            {
                if (SelectedStateId != 0)
                {
                    var entityStateList = ln.Entities.Where(i => i is OT.Patient.Web.Domain.State).Cast<OT.Patient.Web.Domain.State>().ToList();
                    entityStateList = entityStateList.Where(t => t.StateId == SelectedStateId).ToList();
                    SelectedStateName = entityStateList[0].Name;
                }
                Context = new SearchProviderDomainContext();
                var QueryName = Context.GetVw_AdvanceSearchQuery();
                Context.Load(QueryName, LoadBehavior.RefreshCurrent, MyQueryNameCallBackup, null);
            }
        }
        private void MyQueryNameCallBackup(LoadOperation ln)
        {
            if (Isvalidation())
            {
                int ZipCode = CheckZipCode((ZipToName));
                int SelectedStateId = SelectedNameState != null ? Convert.ToInt16(SelectedNameState) : 0;
                int SelectedCity = SelectedNameCity != null ? Convert.ToInt16(SelectedNameCity) : 0;

                bool isChecked = IsCheckName;
                if (!ln.HasError)
                {
                    string strTest = SpecialtyToName;
                    var entitySearchList = ln.Entities.Where(i => i is vw_AdvanceSearch).Cast<vw_AdvanceSearch>().ToList();
                    entitySearchList = entitySearchList.Where(t => t.LastName.ToLower().StartsWith(LastNameToName.ToLower())).ToList();
                    if (!string.IsNullOrEmpty(FirstNameToName))
                        entitySearchList = entitySearchList.Where(t => t.FirstName.ToLower().StartsWith(FirstNameToName.ToLower())).ToList();
                    AdvancedProviderSearchViewModel.ResultData = new ObservableCollection<vw_AdvanceSearch>();
                    if (!string.IsNullOrEmpty(SpecialtyToName))
                    {
                        string[] strSpecialtyArray = SpecialtyToName.Split(',').Distinct().ToArray();
                        string strSpecialty = string.Empty;
                        if (strSpecialtyArray.Contains("All Specialties") == false)
                        {
                            foreach (string strProviderSpecialty in strSpecialtyArray)
                            {
                                if (!string.IsNullOrEmpty(strProviderSpecialty))
                                {
                                    if (string.IsNullOrEmpty(strSpecialty))
                                        strSpecialty = strProviderSpecialty;
                                    else
                                    {
                                        if (!strSpecialty.Contains(strProviderSpecialty))
                                            strSpecialty = strSpecialty + "," + strProviderSpecialty;
                                    }
                                    string specialty = strProviderSpecialty.ToString();
                                    if (IsCheckName)
                                    {
                                        string specialtyPrimary = "(Primary) " + strProviderSpecialty.ToString();
                                        var entitySearch = entitySearchList.Where(t => t.Specilties_new.Contains(specialtyPrimary)).ToList();
                                        if (entitySearch != null)
                                        {
                                            foreach (var item in entitySearch)
                                            {
                                                AdvancedProviderSearchViewModel.ResultData.Add(item);
                                            }
                                        }
                                        //entitySearchList = entitySearchList.Where(t => t.Specilties_new.Contains("(Primary) " + specialty)).ToList();
                                    }
                                    else
                                    {
                                        var entitySearch = entitySearchList.Where(t => t.Specilties_new.Contains(specialty)).ToList();
                                        if (entitySearch != null)
                                        {
                                            foreach (var item in entitySearch)
                                            {
                                                AdvancedProviderSearchViewModel.ResultData.Add(item);
                                            }
                                        }
                                        //entitySearchList = entitySearchList.Where(t => t.Specilties_new.Contains(specialty)).ToList();
                                    }
                                    SpecialtyToName = strSpecialty;
                                }
                            }
                        }
                        else
                        {
                            SpecialtyToName = "All Specialties";
                            AdvancedProviderSearchViewModel.ResultData = new ObservableCollection<vw_AdvanceSearch>(entitySearchList);
                        }
                    }
                    else
                    {
                        AdvancedProviderSearchViewModel.ResultData = new ObservableCollection<vw_AdvanceSearch>(entitySearchList);
                    }
                    var entitySearchListNew = AdvancedProviderSearchViewModel.ResultData.ToList();
                    if (string.IsNullOrEmpty(FirstNameToName))
                        FirstNameToName = "Not Provided";
                    if (string.IsNullOrEmpty(SpecialtyToName))
                        SpecialtyToName = "Not Provided";
                    if (!string.IsNullOrEmpty(ZipToName))
                        entitySearchListNew = entitySearchListNew.Where(t => t.ZipCode == ZipCode.ToString()).ToList();
                    else
                        ZipToName = "Not Provided";
                    if (SelectedCity != 0)
                        entitySearchListNew = entitySearchListNew.Where(t => t.CityId == SelectedCity).ToList();
                    else
                        SelectedCityName = "Not Provided";
                    if (SelectedStateId != 0)
                        entitySearchListNew = entitySearchListNew.Where(t => t.stateId == SelectedStateId).ToList();
                    else
                        SelectedStateName = "Not Provided";
                    AdvancedProviderSearchViewModel.ResultData = new ObservableCollection<vw_AdvanceSearch>(entitySearchListNew.Distinct());
                    //AdvancedProviderSearchViewModel.ResultData = new ObservableCollection<vw_AdvanceSearch>(entitySearchList);
                    AdvancedProviderSearchViewModel.Count = AdvancedProviderSearchViewModel.ResultData.Count.ToString() + " providers found";
                    AdvancedProviderSearchViewModel.FirstNameToName = FirstNameToName;
                    AdvancedProviderSearchViewModel.LastNameToName = LastNameToName;
                    AdvancedProviderSearchViewModel.SpecialtyToName = SpecialtyToName;
                    AdvancedProviderSearchViewModel.SelectedCityName = SelectedCityName;
                    AdvancedProviderSearchViewModel.SelectedStateName = SelectedStateName;
                    AdvancedProviderSearchViewModel.ZipToName = ZipToName;

                    this.OnPropertyChanged("ResultData");
                    HtmlPage.Window.Navigate(new Uri("OT.Patient.aspx#/Patient/SearchWithCriteria", UriKind.RelativeOrAbsolute));
                }
            }
        }

        #endregion

        #region Search Availabilty

        private void AvailabiltySearchCommand_Execute(object o)
        {
            Context2 = new SearchProviderDomainContext();
            var Query = Context2.GetVw_AdvanceSearchAvailabiltyQuery();
            Context2.Load(Query, LoadBehavior.RefreshCurrent, MyQueryAvailabiltyCallBackup, null);

        }
        private void MyQueryAvailabiltyCallBackup(LoadOperation ln)
        {
            if (IsAvailabiltyValidation())
            {
                int ZipCode = CheckZipCode((AvailabiltyZipCode));

                if (string.IsNullOrEmpty(AppointmentDuration) || AppointmentDuration == "15 Minutes")
                    AppointmentDuration = "15";
                else if (AppointmentDuration == "30 Minutes")
                    AppointmentDuration = "30";
                else if (AppointmentDuration == "45 Minutes")
                    AppointmentDuration = "45";
                else if (AppointmentDuration == "1 Minutes")
                    AppointmentDuration = "1";
                else if (AppointmentDuration == "2 Minutes")
                    AppointmentDuration = "2";
                else if (AppointmentDuration == "4 Minutes")
                    AppointmentDuration = "4";

                int SelectedStateId = SelectedAvailabiltyState != null ? Convert.ToInt16(SelectedAvailabiltyState) : 0;
                int SelectedCity = SelectedAvailabiltyCity != null ? Convert.ToInt16(SelectedAvailabiltyCity) : 0;
                if (!ln.HasError)
                {

                    var entitySearchList = ln.Entities.Where(i => i is vw_AdvanceSearchAvailabilty).Cast<vw_AdvanceSearchAvailabilty>().ToList();
                    entitySearchList = entitySearchList.Where(t => t.NewAppointmentDate != AppointmentDate || t.NewAppointmentTime != AppointmentTime || t.AppointmentDuration != AppointmentDuration).ToList();
                    AdvancedProviderSearchViewModel.AvailabiltyResultData = new ObservableCollection<vw_AdvanceSearchAvailabilty>();
                    if (entitySearchList.Count != 0)
                    {
                        if (!string.IsNullOrEmpty(SpecialtyToName))
                        {
                            string[] strSpecialtyArray = SpecialtyToName.Split(',').Distinct().ToArray(); ;
                            string strSpecialty = string.Empty;
                            if (strSpecialtyArray.Contains("All Specialties") == false)
                            {
                                foreach (string strProviderSpecialty in strSpecialtyArray)
                                {
                                    if (!string.IsNullOrEmpty(strProviderSpecialty))
                                    {
                                        strSpecialty = strSpecialty + "," + strProviderSpecialty;
                                        string specialty = strProviderSpecialty.ToString();
                                        if (IsCheckPrmaryAvailability)
                                        {
                                            string specialtyPrimary = "(Primary) " + strProviderSpecialty.ToString();
                                            var entitySearch = entitySearchList.Where(t => t.Specilties_new.Contains(specialtyPrimary)).ToList();
                                            if (entitySearch != null)
                                            {
                                                foreach (var item in entitySearch)
                                                {
                                                    AdvancedProviderSearchViewModel.AvailabiltyResultData.Add(item);
                                                }
                                            }

                                            //entitySearchList = entitySearchList.Where(t => t.Specilties_new.Contains("(Primary) " + specialty)).ToList();

                                        }
                                        else
                                        {

                                            var entitySearch = entitySearchList.Where(t => t.Specilties_new.Contains(specialty)).ToList();
                                            if (entitySearch != null)
                                            {
                                                foreach (var item in entitySearch)
                                                {
                                                    AdvancedProviderSearchViewModel.AvailabiltyResultData.Add(item);
                                                }
                                            }
                                            //entitySearchList = entitySearchList.Where(t => t.Specilties_new.Contains(specialty)).ToList();
                                        }
                                    }
                                }
                            }
                            else
                            {
                                AdvancedProviderSearchViewModel.AvailabiltyResultData = new ObservableCollection<vw_AdvanceSearchAvailabilty>(entitySearchList);
                            }
                        }
                        else
                        {
                            AdvancedProviderSearchViewModel.AvailabiltyResultData = new ObservableCollection<vw_AdvanceSearchAvailabilty>(entitySearchList);
                        }
                        var entitySearchListNew = AdvancedProviderSearchViewModel.AvailabiltyResultData.ToList();
                        if (!string.IsNullOrEmpty(AvailabiltyZipCode))
                            entitySearchListNew = entitySearchListNew.Where(t => t.ZipCode == ZipCode.ToString()).ToList();
                        if (SelectedCity != 0)
                            entitySearchListNew = entitySearchListNew.Where(t => t.CityId == SelectedCity).ToList();
                        if (SelectedStateId != 0)
                            entitySearchListNew = entitySearchListNew.Where(t => t.stateId == SelectedStateId).ToList();
                        AdvancedProviderSearchViewModel.AvailabiltyResultData = new ObservableCollection<vw_AdvanceSearchAvailabilty>(entitySearchListNew.Distinct());
                    }
                    AdvancedProviderSearchViewModel.Count = AdvancedProviderSearchViewModel.AvailabiltyResultData.Count.ToString() + " providers found";
                    this.OnPropertyChanged("AvailabiltyResultData");
                    HtmlPage.Window.Navigate(new Uri("OT.Patient.aspx#/Patient/SearchResults", UriKind.RelativeOrAbsolute));
                }
            }
        }
        #endregion

        #region Search SearchSpecialty
        private void SpecialtySearchCommand_Execute(object o)
        {

            Context2 = new SearchProviderDomainContext();
            var Query = Context2.GetVw_AdvanceSearchSpecialtyQuery();
            Context2.Load(Query, LoadBehavior.RefreshCurrent, MyQuerySpecialtyCallBackup, null);

        }
        private void MyQuerySpecialtyCallBackup(LoadOperation ln)
        {
            int ZipCode = CheckZipCode((SpecialtyZipCode));
            if (IsSpecialtyValidation())
            {
                string SelectedPrimaryList1 = SelectedPrimaryList;
                string SelectedSecondryList1 = SelectedSecondryList;

                int SelectedStateId = SelectedSpecialtyState != null ? Convert.ToInt16(SelectedSpecialtyState) : 0;
                int SelectedCity = SelectedSpecialtyCity != null ? Convert.ToInt16(SelectedSpecialtyCity) : 0;

                if (!ln.HasError)
                {
                    var entitySearchList = ln.Entities.Where(i => i is vw_AdvanceSearchSpecialty).Cast<vw_AdvanceSearchSpecialty>().ToList();
                    if (!string.IsNullOrEmpty(SelectedPrimaryList))
                    {
                        string[] strPrimaryArray = SelectedPrimaryList.Split(',').Distinct().ToArray();
                        string strPrimary = string.Empty;
                        AdvancedProviderSearchViewModel.SpecialtyResultData = new ObservableCollection<vw_AdvanceSearchSpecialty>();
                        if (strPrimaryArray.Contains("All Specialties") == false)
                        {
                            foreach (string strProviderSpecialty in strPrimaryArray)
                            {
                                if (!string.IsNullOrEmpty(strProviderSpecialty))
                                {
                                    string specialty = "(Primary) " + strProviderSpecialty.ToString();
                                    var entitySearch = entitySearchList.Where(t => t.Specilties_new.Contains(specialty)).ToList();
                                    if (entitySearch != null)
                                    {
                                        foreach (var item in entitySearch)
                                        {
                                            AdvancedProviderSearchViewModel.SpecialtyResultData.Add(item);
                                        }

                                    }
                                }
                            }
                            if (!string.IsNullOrEmpty(SelectedSecondryList))
                            {
                                string[] strSecondryArray = SelectedSecondryList.Split(',').Distinct().ToArray();
                                string strSecondry = string.Empty;
                                if (strSecondryArray.Contains("All Specialties") == false)
                                {
                                    string abc = string.Empty;
                                    foreach (string strProviderSpecialty in strSecondryArray)
                                    {
                                        if (!string.IsNullOrEmpty(strProviderSpecialty))
                                        {
                                            string specialty = strProviderSpecialty.ToString();
                                            var entitySearchSecondary = AdvancedProviderSearchViewModel.SpecialtyResultData.Where(t => t.Specilties_new.Contains(specialty)).ToList();
                                            if (entitySearchSecondary != null)
                                            {
                                                foreach (var item in entitySearchSecondary)
                                                {
                                                    AdvancedProviderSearchViewModel.SpecialtyResultData.Add(item);
                                                }

                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            AdvancedProviderSearchViewModel.SpecialtyResultData = new ObservableCollection<vw_AdvanceSearchSpecialty>(entitySearchList.Distinct());
                        }
                    }

                    var entitySearchNew = AdvancedProviderSearchViewModel.SpecialtyResultData.ToList();
                    if (!string.IsNullOrEmpty(SpecialtyZipCode))
                        entitySearchNew = entitySearchNew.Where(t => t.ZipCode == ZipCode.ToString()).ToList();
                    if (SelectedCity != 0)
                        entitySearchNew = entitySearchNew.Where(t => t.CityId == SelectedCity).ToList();
                    if (SelectedStateId != 0)
                        entitySearchNew = entitySearchNew.Where(t => t.stateId == SelectedStateId).ToList();
                    AdvancedProviderSearchViewModel.SpecialtyResultData = new ObservableCollection<vw_AdvanceSearchSpecialty>(entitySearchNew.Distinct());
                    //AdvancedProviderSearchViewModel.SpecialtyResultData = new ObservableCollection<vw_AdvanceSearchSpecialty>(entitySearchList);
                    AdvancedProviderSearchViewModel.Count = AdvancedProviderSearchViewModel.SpecialtyResultData.Count.ToString() + " providers found";
                    this.OnPropertyChanged("SpecialtyResultData");
                    HtmlPage.Window.Navigate(new Uri("OT.Patient.aspx#/Patient/SearchResults", UriKind.RelativeOrAbsolute));
                }
            }

        }

        #endregion

        #endregion

        #region CallBackup

        #region FillSpecialties
        private void MyCallBackup(LoadOperation lo)
        {

            if (!lo.HasError)
            {
                var entityList = lo.Entities.Where(i => i is vw_multilanguageDropdownData).Cast<vw_multilanguageDropdownData>().ToList().Distinct().ToList();
                entityList = entityList.Where(t => t.LanguageID == Constants.English && t.Title == Constants.Specialty).ToList().Distinct().ToList().Distinct().ToList();
                ProvidersSpecialtiesToName = new Dictionary<string, string>();
                ProvidersSpecialtiesToName.Add("0", "All Specialties");
                ProvidersSpecialtiesToPrimary = new Dictionary<string, string>();
                ProvidersSpecialtiesToPrimary.Add("0", "All Specialties");
                ProvidersSpecialtiesToSecondry = new Dictionary<string, string>();
                ProvidersSpecialtiesToSecondry.Add("0", "All Specialties");
                foreach (var item in entityList)
                {
                    ProvidersSpecialtiesToName.Add(item.FeildID.ToString(), item.Value);
                    ProvidersSpecialtiesToPrimary.Add(item.FeildID.ToString(), item.Value);
                    ProvidersSpecialtiesToSecondry.Add(item.FeildID.ToString(), item.Value);
                }
                ProvidersSpecialtiesList = ProvidersSpecialtiesToName;
                ProvidersSpecialtiesPrimary = ProvidersSpecialtiesToPrimary;
                ProvidersSpecialtiesSecondry = ProvidersSpecialtiesToSecondry;

            }
        }
        #endregion

        #region FillState
        private void MyStatesCallBackup(LoadOperation lo)
        {
            if (!lo.HasError)
            {
                var entityList = lo.Entities.Where(i => i is vw_multilanguageDropdownData).Cast<vw_multilanguageDropdownData>().ToList().Distinct().ToList();
                entityList = entityList.Where(t => t.LanguageID == Constants.English && t.Title == Constants.States).ToList().Distinct().ToList();
                StateList = new Dictionary<string, string>();
                StateList.Add("0", "---Select---");

                var entityCityList = lo.Entities.Where(i => i is vw_multilanguageDropdownData).Cast<vw_multilanguageDropdownData>().ToList().Distinct().ToList();
                entityCityList = entityCityList.Where(t => t.LanguageID == Constants.English && t.Title == Constants.City).ToList().Distinct().ToList();

                CityList = new Dictionary<string, string>();
                CityList.Add("0", "---Select---");
                foreach (var item in entityCityList)
                {
                    CityList.Add(item.FeildID.ToString(), item.Value);
                }
                CitiesList = CityList;
                foreach (var item in entityList)
                {
                    StateList.Add(item.FeildID.ToString(), item.Value);
                }
                StatesList = StateList;
            }
        }
        #endregion

        #endregion

        #region Validation

        private bool Isvalidation()
        {

            if (string.IsNullOrEmpty(LastNameToName))
            {
                ValidateBorderBrush = "Red";
                return false;
            }
            else
            {
                ValidateBorderBrush = "Gray";
                return true;
            }

        }
        public int CheckZipCode(string zipCode)
        {
            try
            {
                if (!string.IsNullOrEmpty(zipCode))
                    return Convert.ToInt32(zipCode);
                else
                    return 0;
            }
            catch (Exception)
            {

                return 0;
            }

        }

        private bool IsAvailabiltyValidation()
        {

            if (string.IsNullOrEmpty(AppointmentDate.ToString()) || string.IsNullOrEmpty(AppointmentTime.ToString()) || string.IsNullOrEmpty(AppointmentDuration))
            {
                ValidateAvailabiltyBorderBrush = "Red";
                return false;
            }
            else
            {
                ValidateAvailabiltyBorderBrush = "Gray";
                return true;
            }

        }

        private bool IsSpecialtyValidation()
        {
            if (string.IsNullOrEmpty(SelectedPrimaryList))
            {
                ValidateSpecialtyBorderBrush = "Red";
                return false;
            }
            else
            {
                ValidateSpecialtyBorderBrush = "Gray";
                return true;
            }

        }
        #endregion

        #endregion
    }

    public class DashBoardAppointment:ViewModelBase
    {
        private int _providerId;
       // private DashboardViewModel _view;

     
        public int ProviderId
        {
            get { return _providerId; }
            set { _providerId = value; OnPropertyChanged("ProviderId"); }
        }

        private int _patientId;
        public int PatientId
        {
            get { return _patientId; }
            set { _patientId = value; OnPropertyChanged("PatientId"); }
        }

        private Nullable<DateTime> _newAppointmentDate;
        public Nullable<DateTime> NewAppointmentDate
        {
            get { return _newAppointmentDate; }
            set { _newAppointmentDate = value; OnPropertyChanged("NewAppointmentDate"); }
        }

        private string _patient;
        public string Patient
        {
            get { return _patient; }
            set { _patient = value; OnPropertyChanged("Patient"); }
        }

        private string _provider;
        public string Provider
        {
            get { return _provider; }
            set { _provider = value; OnPropertyChanged("Provider"); }
        }

        private int _appointmentId;
        public int AppointmentId
        {
            get { return _appointmentId; }
            set { _appointmentId = value; OnPropertyChanged("AppointmentId"); }
        }

        private int _appointmentStatusId;
        public int AppointmentStatusId
        {
            get { return _appointmentStatusId; }
            set { _appointmentStatusId = value; OnPropertyChanged("AppointmentStatusId"); }
        }

        public DashBoardAppointment()
        {

        }
        public DashBoardAppointment(int appointmentId, int appointmentStatusId, int providerId, int patientId, Nullable<DateTime> newAppointmentDate, string patient, string provider)
        {
            this.AppointmentId = appointmentId;
            this.AppointmentStatusId = appointmentStatusId;
            this.ProviderId = providerId;
            this.PatientId = patientId;
            this.NewAppointmentDate = newAppointmentDate;
            this.Patient = patient;
            this.Provider = provider;
        }

    }
}
----------------------------------

 

Please lets me know if i missing something.

Thanks
Sagar.




0
Zarko
Telerik team
answered on 03 May 2011, 12:16 PM
Hello deepak,

 Could you please see the answer here?

All the best,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
deepak
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
deepak
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or