00b25577f06fb17138f7be6e92f98ff9a379e6c8
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Xaml / TotalSample / TotalSample.xaml.cs
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.Collections.Generic;
19 using System.Globalization;
20 using Tizen.NUI;
21 using Tizen.NUI.BaseComponents;
22 using Tizen.NUI.Binding;
23 using Tizen.NUI.Components;
24 using Tizen.NUI.Xaml;
25 //using static Tizen.NUI.Xaml.VisualStateManager;
26
27 namespace Tizen.NUI.Devel.Tests
28 {
29     public class FloatToStringConverter : IValueConverter
30     {
31         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
32         {
33             return String.Format("Value is {0}", (float)value);
34         }
35
36         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
37         {
38             //return (bool)value ? 1 : 0;
39             return null;
40         }
41     }
42
43     public partial class TotalSample : UIElement
44     {
45                 private void LoadEXaml()
46         {
47             eXamlData = global::Tizen.NUI.EXaml.EXamlExtensions.LoadFromEXamlByRelativePath(this, @"examl/Tizen.NUI.Devel.Tests.TotalSample.examl");
48             global::Tizen.NUI.EXaml.EXamlExtensions.RemoveEventsInXaml(eXamlData);
49             global::Tizen.NUI.EXaml.EXamlExtensions.DisposeXamlElements(this);
50         }
51                 
52                 private void UIElementEvent(object sender, EventArgs e)
53         {
54         }
55
56         private void StaticUIElementEvent(object sender, EventArgs e)
57         {
58         }
59
60         private void LoadXaml()
61         {
62             global::Tizen.NUI.Xaml.Extensions.LoadFromXaml(this, typeof(TotalSample));
63         }
64                 
65         public TotalSample(bool examl = false)
66         {
67             if (examl)
68             {
69                 LoadEXaml();
70             }
71             else
72             {
73                 InitializeComponent();
74             }
75         }
76     }
77 }