TizenRefApp-8629 Implement Call view 32/150432/9
authorRuslan Zakharov <r.zakharov@samsung.com>
Fri, 15 Sep 2017 13:40:27 +0000 (16:40 +0300)
committerRuslan Zakharov <r.zakharov@samsung.com>
Thu, 2 Nov 2017 12:24:30 +0000 (14:24 +0200)
Refactoring before implementation

Change-Id: I84abae761d392306541af418ed0f070cd54e4118

15 files changed:
CallApp.Tizen/App.xaml.cs
CallApp.Tizen/Call/Manager/CallManager.cs
CallApp.Tizen/Call/Model/CallBase.cs
CallApp.Tizen/Call/Model/CallModel.cs
CallApp.Tizen/Call/Model/ConferenceCallModel.cs
CallApp.Tizen/Call/Model/ContactModel.cs
CallApp.Tizen/Call/View/Controls/CallHandlingPanel.xaml
CallApp.Tizen/Call/View/Controls/CallHandlingPanel.xaml.cs
CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml
CallApp.Tizen/Call/View/Controls/FlatButton.xaml
CallApp.Tizen/Call/View/Controls/FlatButton.xaml.cs
CallApp.Tizen/Call/View/Controls/FlatCheckbox.xaml
CallApp.Tizen/Call/View/Controls/FlatCheckbox.xaml.cs
CallApp.Tizen/Call/View/Controls/Keypad.xaml
CallApp.Tizen/Call/ViewModel/MainViewModel.cs

index 94db8fb..c7d78a5 100644 (file)
@@ -32,7 +32,7 @@ namespace CallApp
 
             MainPage = new MainPage();
 
-            // FIXME: Test only
+            // FIXME: This code only for testing. Need to remove after Call API is completed
             MainPage.BindingContext = new MainViewModel(new CallManager());
             //
         }
index fc1ebc6..14d8cd1 100644 (file)
@@ -16,7 +16,7 @@
 
 using CallApp.Tizen.Call.Model;
 using CallApp.Tizen.Call.Provider;
-using System.Collections.Generic;
+using System.Collections.ObjectModel;
 
 namespace CallApp.Tizen.Call.Manager
 {
@@ -27,23 +27,23 @@ namespace CallApp.Tizen.Call.Manager
     {
         public CallManager()
         {
-            Calls = new List<CallBase>();
+            Calls = new ObservableCollection<CallBase>();
             ContactsProvider = new ContactProvider();
         }
 
         /// <summary>
         /// All calls of app
         /// </summary>
-        public List<CallBase> Calls
+        public ObservableCollection<CallBase> Calls
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// Gets a provider that provide info about contacts
+        /// Gets a provider that provide info about contact
         /// </summary>
-        public ContactProvider ContactsProvider
+        public ContactProvider ContactProvider
         {
             get;
             private set;
index c259028..724df64 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+using Tizen.Utility.Helpers;
+
 namespace CallApp.Tizen.Call.Model
 {
     /// <summary>
@@ -31,7 +33,7 @@ namespace CallApp.Tizen.Call.Model
     /// <summary>
     /// Base class of call model
     /// </summary>
-    public class CallBase
+    public class CallBase : BaseModel
     {
         public CallBase(uint id)
         {
@@ -41,10 +43,19 @@ namespace CallApp.Tizen.Call.Model
         /// <summary>
         /// Gets or sets a call status
         /// </summary>
+        private CallStatus _status = CallStatus.Active;
         public CallStatus Status
         {
-            get;
-            internal set;
+            get
+            {
+                return _status;
+            }
+            internal set
+            {
+                _status = value;
+
+                OnPropertyChanged();
+            }
         }
 
         /// <summary>
index 49e043b..af79d22 100644 (file)
@@ -28,19 +28,37 @@ namespace CallApp.Tizen.Call.Model
         /// <summary>
         /// Model of contact
         /// </summary>
+        private ContactModel _contactModel = new ContactModel();
         public ContactModel ContactModel
         {
-            get;
-            internal set;
+            get
+            {
+                return _contactModel;
+            }
+            internal set
+            {
+                _contactModel = value;
+
+                OnPropertyChanged();
+            }
         }
 
         /// <summary>
         /// Number of caller
         /// </summary>
+        private string _callerNumber = string.Empty;
         public string CallerNumber
         {
-            get;
-            internal set;
+            get
+            {
+                return _callerNumber;
+            }
+            internal set
+            {
+                _callerNumber = value;
+
+                OnPropertyChanged();
+            }
         }
 
         /// <summary>
index 2346f82..f741308 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-using System.Collections.Generic;
+using System.Collections.ObjectModel;
 
 namespace CallApp.Tizen.Call.Model
 {
@@ -30,7 +30,7 @@ namespace CallApp.Tizen.Call.Model
         /// <summary>
         /// All calls of conference
         /// </summary>
-        public List<CallModel> Calls
+        public ObservableCollection<CallModel> Calls
         {
             get;
             internal set;
index 1ada7d7..0160807 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+using Tizen.Utility.Helpers;
 using Xamarin.Forms;
 
 namespace CallApp.Tizen.Call.Model
@@ -21,24 +22,42 @@ namespace CallApp.Tizen.Call.Model
     /// <summary>
     /// Model of contact
     /// </summary>
-    public class ContactModel
+    public class ContactModel : BaseModel
     {
         /// <summary>
         /// Photo of contact
         /// </summary>
+        private Image _photo = null;
         public Image Photo
         {
-            get;
-            internal set;
+            get
+            {
+                return _photo;
+            }
+            internal set
+            {
+                _photo = value;
+
+                OnPropertyChanged();
+            }
         }
 
         /// <summary>
         /// Name of contact
         /// </summary>
+        private string _name = string.Empty;
         public string Name
         {
-            get;
-            internal set;
+            get
+            {
+                return _name;
+            }
+            internal set
+            {
+                _name = value;
+
+                OnPropertyChanged();
+            }
         }
     }
 }
index 47ad870..55dab72 100644 (file)
@@ -2,6 +2,7 @@
 <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="CallApp.Tizen.Call.View.Controls.CallHandlingPanel"
+             x:Name="This"
              xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls"
              xmlns:Localization="clr-namespace:CallApp.Tizen.Localization"
              xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls">
     <TizenUtilityControls:CustomGrid>
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>
 
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto" />
-            <RowDefinition Height="152" />
+            <RowDefinition Height="Auto" />
         </Grid.RowDefinitions>
 
-        <TizenUtilityControls:CustomGrid Grid.Column="0" Grid.Row="0">
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="*" />
-                <ColumnDefinition Width="*" />
-                <ColumnDefinition Width="*" />
-            </Grid.ColumnDefinitions>
-
-            <Grid.RowDefinitions>
-                <RowDefinition Height="Auto" />
-                <RowDefinition Height="Auto" />
-            </Grid.RowDefinitions>
-
-            <Frame Grid.Column="0" Grid.Row="0" Padding="0,0,2,2">
-                <CallControls:FlatCheckbox Image="call_btn_volume.png" Text="{x:Static Localization:Localization.Speaker}" />
-            </Frame>
-            <Frame Grid.Column="1" Grid.Row="0" Padding="0,0,2,2">
-                <CallControls:FlatButton Image="call_btn_keypad.png" Text="{x:Static Localization:Localization.Keypad}" />
-            </Frame>
-            <Frame Grid.Column="2" Grid.Row="0" Padding="0,0,0,2">
-                <CallControls:FlatCheckbox Image="call_btn_bluetooth.png" Text="{x:Static Localization:Localization.Bluetooth}" />
-            </Frame>
-
-            <Frame Grid.Column="0" Grid.Row="1" Padding="0,0,2,2">
-                <CallControls:FlatButton Image="call_btn_addcall.png" Text="{x:Static Localization:Localization.AddCall}" />
-            </Frame>
-            <Frame Grid.Column="1" Grid.Row="1" Padding="0,0,2,2">
-                <CallControls:FlatCheckbox Image="call_btn_mute.png" Text="{x:Static Localization:Localization.Mute}" />
-            </Frame>
-            <Frame Grid.Column="2" Grid.Row="1" Padding="0,0,0,2">
-                <CallControls:FlatButton Image="call_btn_contacts.png" Text="{x:Static Localization:Localization.Contacts}" />
-            </Frame>
-        </TizenUtilityControls:CustomGrid>
+        <Frame Grid.Column="0" Grid.Row="0" Padding="0,0,2,2">
+            <CallControls:FlatCheckbox Image="call_btn_volume.png" Text="{x:Static Localization:Localization.Speaker}"
+                                       Command="{Binding ToggleSpeakerCommand, Source={x:Reference This}}"
+                                       IsChecked="{Binding IsSpeakerOn, Source={x:Reference This}, Mode=TwoWay}" />
+        </Frame>
+        <Frame Grid.Column="1" Grid.Row="0" Padding="0,0,2,2">
+            <CallControls:FlatButton Image="call_btn_keypad.png" Text="{x:Static Localization:Localization.Keypad}"
+                                     Command="{Binding OpenKeypadCommand, Source={x:Reference This}}" />
+        </Frame>
+        <Frame Grid.Column="2" Grid.Row="0" Padding="0,0,0,2">
+            <CallControls:FlatCheckbox Image="call_btn_bluetooth.png" Text="{x:Static Localization:Localization.Bluetooth}"
+                                       Command="{Binding ToggleBluetoothCommand, Source={x:Reference This}}"
+                                       IsChecked="{Binding IsBluetoothOn, Source={x:Reference This}, Mode=TwoWay}" />
+        </Frame>
 
-        <TizenUtilityControls:CustomGrid Grid.Column="0" Grid.Row="1" BackgroundColor="{StaticResource BGColor}">
-            <CallControls:AnimatedCircleButton HorizontalOptions="Center" VerticalOptions="Center" Radius="100"
-                                               AnimationColor="{StaticResource CircleButtonRejectBGColor}" NormalColor="{StaticResource CircleButtonRejectNormalColor}"
-                                               PressColor="{StaticResource CircleButtonRejectPressColor}" Image="call_btn_ic_reject.png" />
-        </TizenUtilityControls:CustomGrid>
+        <Frame Grid.Column="0" Grid.Row="1" Padding="0,0,2,2">
+            <CallControls:FlatButton Image="call_btn_addcall.png" Text="{x:Static Localization:Localization.AddCall}"
+                                     Command="{Binding AddCallCommand, Source={x:Reference This}}" />
+        </Frame>
+        <Frame Grid.Column="1" Grid.Row="1" Padding="0,0,2,2">
+            <CallControls:FlatCheckbox Image="call_btn_mute.png" Text="{x:Static Localization:Localization.Mute}"
+                                       Command="{Binding ToggleMuteCommand, Source={x:Reference This}}"
+                                       IsChecked="{Binding IsMuteOn, Source={x:Reference This}, Mode=TwoWay}" />
+        </Frame>
+        <Frame Grid.Column="2" Grid.Row="1" Padding="0,0,0,2">
+            <CallControls:FlatButton Image="call_btn_contacts.png" Text="{x:Static Localization:Localization.Contacts}"
+                                     Command="{Binding AddContactCommand, Source={x:Reference This}}" />
+        </Frame>
     </TizenUtilityControls:CustomGrid>
 </ContentView>
\ No newline at end of file
index 2d9f680..8f5ddcb 100644 (file)
@@ -27,5 +27,203 @@ namespace CallApp.Tizen.Call.View.Controls
         {
             InitializeComponent();
         }
+
+        /// <summary>
+        /// Toggle speaker command
+        /// </summary>
+        public static readonly BindableProperty ToggleSpeakerCommandProperty = BindableProperty.Create(
+            "ToggleSpeakerCommand",
+            typeof(Command),
+            typeof(CallHandlingPanel),
+            null);
+
+        public Command ToggleSpeakerCommand
+        {
+            get
+            {
+                return (Command)GetValue(ToggleSpeakerCommandProperty);
+            }
+
+            set
+            {
+                SetValue(ToggleSpeakerCommandProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Open keypad command
+        /// </summary>
+        public static readonly BindableProperty OpenKeypadCommandProperty = BindableProperty.Create(
+            "OpenKeypadCommand",
+            typeof(Command),
+            typeof(CallHandlingPanel),
+            null);
+
+        public Command OpenKeypadCommand
+        {
+            get
+            {
+                return (Command)GetValue(OpenKeypadCommandProperty);
+            }
+
+            set
+            {
+                SetValue(OpenKeypadCommandProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Toggle bluetooth command
+        /// </summary>
+        public static readonly BindableProperty ToggleBluetoothCommandProperty = BindableProperty.Create(
+            "ToggleBluetoothCommand",
+            typeof(Command),
+            typeof(CallHandlingPanel),
+            null);
+
+        public Command ToggleBluetoothCommand
+        {
+            get
+            {
+                return (Command)GetValue(ToggleBluetoothCommandProperty);
+            }
+
+            set
+            {
+                SetValue(ToggleBluetoothCommandProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Add call command
+        /// </summary>
+        public static readonly BindableProperty AddCallCommandProperty = BindableProperty.Create(
+            "AddCallCommand",
+            typeof(Command),
+            typeof(CallHandlingPanel),
+            null);
+
+        public Command AddCallCommand
+        {
+            get
+            {
+                return (Command)GetValue(AddCallCommandProperty);
+            }
+
+            set
+            {
+                SetValue(AddCallCommandProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Toggle mute command
+        /// </summary>
+        public static readonly BindableProperty ToggleMuteCommandProperty = BindableProperty.Create(
+            "ToggleMuteCommand",
+            typeof(Command),
+            typeof(CallHandlingPanel),
+            null);
+
+        public Command ToggleMuteCommand
+        {
+            get
+            {
+                return (Command)GetValue(ToggleMuteCommandProperty);
+            }
+
+            set
+            {
+                SetValue(ToggleMuteCommandProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Add contact command
+        /// </summary>
+        public static readonly BindableProperty AddContactCommandProperty = BindableProperty.Create(
+            "AddContactCommand",
+            typeof(Command),
+            typeof(CallHandlingPanel),
+            null);
+
+        public Command AddContactCommand
+        {
+            get
+            {
+                return (Command)GetValue(AddContactCommandProperty);
+            }
+
+            set
+            {
+                SetValue(AddContactCommandProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Is speaker on or not
+        /// </summary>
+        public static readonly BindableProperty IsSpeakerOnProperty = BindableProperty.Create(
+            "IsSpeakerOn",
+            typeof(bool),
+            typeof(CallHandlingPanel),
+            false);
+
+        public bool IsSpeakerOn
+        {
+            get
+            {
+                return (bool)GetValue(IsSpeakerOnProperty);
+            }
+
+            set
+            {
+                SetValue(IsSpeakerOnProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Is bluetooth on or not
+        /// </summary>
+        public static readonly BindableProperty IsBluetoothOnProperty = BindableProperty.Create(
+            "IsBluetoothOn",
+            typeof(bool),
+            typeof(CallHandlingPanel),
+            false);
+
+        public bool IsBluetoothOn
+        {
+            get
+            {
+                return (bool)GetValue(IsBluetoothOnProperty);
+            }
+
+            set
+            {
+                SetValue(IsBluetoothOnProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Is mute on or not
+        /// </summary>
+        public static readonly BindableProperty IsMuteOnProperty = BindableProperty.Create(
+            "IsMuteOn",
+            typeof(bool),
+            typeof(CallHandlingPanel),
+            false);
+
+        public bool IsMuteOn
+        {
+            get
+            {
+                return (bool)GetValue(IsMuteOnProperty);
+            }
+
+            set
+            {
+                SetValue(IsMuteOnProperty, value);
+            }
+        }
     }
 }
index 4ba4365..93225ca 100644 (file)
@@ -4,10 +4,13 @@
              x:Class="CallApp.Tizen.Call.View.Controls.ContactInfoPanel"
              x:Name="This"
              xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls"
-             xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls">
+             xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls"
+             xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters">
 
     <ContentView.Resources>
         <ResourceDictionary>
+            <TizenUtilityConverters:IsNullConverter x:Key="IsNull" />
+
             <ControlTemplate x:Key="ActivePanel">
                 <TizenUtilityControls:CustomGrid HeightRequest="172">
                     <Grid.ColumnDefinitions>
                     <Label Grid.Column="1" Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}"
                            FontSize="27" Text="{TemplateBinding StatusText}" />
 
-                    <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" Source="{TemplateBinding Image}" />
+                    <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center">
+                        <Image.Triggers>
+                            <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="True">
+                                <Setter Property="Source" Value="Call ID/348x348/call_photo_id.png" />
+                            </DataTrigger>
+
+                            <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="False">
+                                <Setter Property="Source" Value="{TemplateBinding Image}" />
+                            </DataTrigger>
+                        </Image.Triggers>
+                    </Image>
 
                     <Label Grid.Column="1" Grid.Row="5" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}"
                            FontSize="47" Text="{TemplateBinding PrimaryText}" />
index 4dfc20f..308cc2a 100644 (file)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
-             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-             x:Class="CallApp.Tizen.Call.View.Controls.FlatButton"
-             xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls"
-             xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters"
-             xmlns:TizenUtilityInput="clr-namespace:Tizen.Utility.Input"
-             ControlTemplate="{StaticResource FlatButtonControlTemplate}">
+<TizenUtilityControls:CustomContentView xmlns="http://xamarin.com/schemas/2014/forms"
+                                        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+                                        x:Class="CallApp.Tizen.Call.View.Controls.FlatButton"
+                                        xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls"
+                                        xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters"
+                                        xmlns:TizenUtilityInput="clr-namespace:Tizen.Utility.Input"
+                                        ControlTemplate="{StaticResource FlatButtonControlTemplate}">
 
     <ContentView.Resources>
         <ResourceDictionary>
@@ -58,4 +58,4 @@
             </ControlTemplate>
         </ResourceDictionary>
     </ContentView.Resources>
-</ContentView>
\ No newline at end of file
+</TizenUtilityControls:CustomContentView>
\ No newline at end of file
index 57da453..19cceac 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+using Tizen.Utility.Controls;
 using Xamarin.Forms;
 
 namespace CallApp.Tizen.Call.View.Controls
@@ -21,7 +22,7 @@ namespace CallApp.Tizen.Call.View.Controls
     /// <summary>
     /// Partial class of FlatButton.xaml
     /// </summary>
-    public partial class FlatButton : ContentView
+    public partial class FlatButton : CustomContentView
     {
         public FlatButton()
         {
index f6bf0d7..9639b26 100644 (file)
@@ -3,12 +3,7 @@
                          xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                          x:Class="CallApp.Tizen.Call.View.Controls.FlatCheckbox"
                          x:Name="This"
-                         xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls"
-                         xmlns:Extension="clr-namespace:Tizen.Xamarin.Forms.Extension;assembly=Tizen.Xamarin.Forms.Extension">
-
-    <CallControls:FlatButton.GestureRecognizers>
-        <Extension:LongTapGestureRecognizer TapStarted="OnTapStart" />
-    </CallControls:FlatButton.GestureRecognizers>
+                         xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls">
 
     <CallControls:FlatButton.Triggers>
         <DataTrigger TargetType="CallControls:FlatButton" Binding="{Binding IsChecked, Source={x:Reference This}}" Value="True">
index 7937830..5a6217f 100644 (file)
@@ -95,8 +95,10 @@ namespace CallApp.Tizen.Call.View.Controls
             }
         }
 
-        private void OnTapStart(object sender, EventArgs e)
+        protected override void OnTap(object sender, EventArgs e)
         {
+            base.OnTap(sender, e);
+
             IsChecked = !IsChecked;
         }
     }
index 474179c..1250646 100644 (file)
@@ -2,6 +2,7 @@
 <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="CallApp.Tizen.Call.View.Controls.Keypad"
+             x:Name="This"
              xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls"
              xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls">
 
         </Grid.RowDefinitions>
 
         <Frame Grid.Column="0" Grid.Row="0" Padding="0,0,2,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_01.png" KeyImage="keypad_english_13.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_01.png" KeyImage="keypad_english_13.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="1" />
         </Frame>
         <Frame Grid.Column="1" Grid.Row="0" Padding="0,0,2,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_02.png" KeyImage="keypad_english_01.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_02.png" KeyImage="keypad_english_01.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="2" />
         </Frame>
         <Frame Grid.Column="2" Grid.Row="0" Padding="0,0,0,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_03.png" KeyImage="keypad_english_02.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_03.png" KeyImage="keypad_english_02.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="3" />
         </Frame>
 
         <Frame Grid.Column="0" Grid.Row="1" Padding="0,0,2,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_04.png" KeyImage="keypad_english_03.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_04.png" KeyImage="keypad_english_03.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="4" />
         </Frame>
         <Frame Grid.Column="1" Grid.Row="1" Padding="0,0,2,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_05.png" KeyImage="keypad_english_04.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_05.png" KeyImage="keypad_english_04.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="5" />
         </Frame>
         <Frame Grid.Column="2" Grid.Row="1" Padding="0,0,0,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_06.png" KeyImage="keypad_english_05.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_06.png" KeyImage="keypad_english_05.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="6" />
         </Frame>
 
         <Frame Grid.Column="0" Grid.Row="2" Padding="0,0,2,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_07.png" KeyImage="keypad_english_06.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_07.png" KeyImage="keypad_english_06.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="7" />
         </Frame>
         <Frame Grid.Column="1" Grid.Row="2" Padding="0,0,2,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_08.png" KeyImage="keypad_english_07.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_08.png" KeyImage="keypad_english_07.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="8" />
         </Frame>
         <Frame Grid.Column="2" Grid.Row="2" Padding="0,0,0,2">
-            <CallControls:KeypadButton NumberImage="keypad_number_09.png" KeyImage="keypad_english_08.png" />
+            <CallControls:KeypadButton NumberImage="keypad_number_09.png" KeyImage="keypad_english_08.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="9" />
         </Frame>
 
-        <Frame Grid.Column="0" Grid.Row="3" Padding="0,0,2,0">
-            <CallControls:KeypadButton NumberImage="keypad_number_asterisk.png" />
+        <Frame Grid.Column="0" Grid.Row="3" Padding="0,0,2,2">
+            <CallControls:KeypadButton NumberImage="keypad_number_asterisk.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="*" />
         </Frame>
-        <Frame Grid.Column="1" Grid.Row="3" Padding="0,0,2,0">
-            <CallControls:KeypadButton NumberImage="keypad_number_00.png" KeyImage="keypad_english_10.png" />
+        <Frame Grid.Column="1" Grid.Row="3" Padding="0,0,2,2">
+            <CallControls:KeypadButton NumberImage="keypad_number_00.png" KeyImage="keypad_english_10.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="0" />
+        </Frame>
+        <Frame Grid.Column="2" Grid.Row="3" Padding="0,0,0,2">
+            <CallControls:KeypadButton NumberImage="keypad_number_sharp.png"
+                                       Command="{Binding KeyPush, Source={x:Reference This}}" CommandParameter="#" />
         </Frame>
-        <CallControls:KeypadButton Grid.Column="2" Grid.Row="3" NumberImage="keypad_number_sharp.png" />
     </TizenUtilityControls:CustomGrid>
 </ContentView>
\ No newline at end of file
index dcefe6d..f1f5c6a 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+using CallApp.Tizen.Call.Helper;
 using CallApp.Tizen.Call.Manager;
 using Tizen.Utility.Helpers;
 
@@ -26,7 +27,7 @@ namespace CallApp.Tizen.Call.ViewModel
     {
         private readonly CallManager _callManager = null;
 
-        // FIXME: Due to warning "is assigned but its value is never used"
+        // FIXME: Due to warning "is assigned but its value is never used". Need open after Call API is completed
         /*
         private readonly CallViewModel _callVM = null;
         private readonly ConferenceCallViewModel _conferenceCallVM = null;
@@ -39,8 +40,8 @@ namespace CallApp.Tizen.Call.ViewModel
         {
             _callManager = callManager;
 
-            // FIXME: Test only
-            CurrentVM = new CallViewModel(_callManager);
+            // FIXME: This code only for testing. Need to remove after Call API is completed
+            CurrentVM = TestModelCreator.CreateCallViewModel();
             //
         }