Commit 1280ef98 authored by atraczyk's avatar atraczyk Committed by Andreas Traczyk

xaml: move all xaml bind converters to their own files

Change-Id: I13e81ffaf94e7e2d7f2032c71d0f772272963837
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent d78f721e
......@@ -21,45 +21,46 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RingClientUWP"
xmlns:views="using:RingClientUWP.Views"
xmlns:cnv="using:RingClientUWP.Converters"
xmlns:uc="using:RingClientUWP.UserAndCustomControls">
<Application.Resources>
<ResourceDictionary>
<!-- converters -->
<views:BubbleBackground x:Key="_bubbleBackground_" />
<views:BubbleHorizontalAlignement x:Key="_bubbleHorizontalAlignement_" />
<views:boolToVisibility x:Key="_boolToVisibility_" />
<views:MessageDateTimeString x:Key="_MessageDateTimeString_" />
<views:MessageChainBreakToVisibility x:Key="_MessageChainBreakToVisibility_" />
<views:MessageChainBreakToHeight x:Key="_MessageChainBreakToHeight_" />
<views:CachedImageConverter x:Key="_CachedImageConverter_" />
<views:NameToInitialConverter x:Key="_NameToInitialConverter_" />
<views:NewMessageBubbleNotification x:Key="_NewMessageBubbleNotification_" />
<views:NewMessageNotificationToNumber x:Key="_NewMessageNotificationToNumber_" />
<views:IncomingVisibility x:Key="_IncomingVisibility_" />
<views:OutGoingVisibility x:Key="_OutGoingVisibility_" />
<views:HasAnActiveCall x:Key="_HasAnActiveCall_" />
<views:HasAvatarToVisibility x:Key="_HasAvatarToVisibility_" />
<views:AccountTypeToSourceImage x:Key="_AccountTypeToSourceImage_" />
<views:RingAccountTypeToVisibility x:Key="_RingAccountTypeToVisibility_" />
<views:AccountSelectedToVisibility x:Key="_AccountSelectedToVisibility_" />
<views:CollapseEmptyString x:Key="_CollapseEmptyString_" />
<views:ContactStatusNotification x:Key="_ContactStatusNotification_" />
<views:uintToVisibility x:Key="_uintToVisibility_" />
<views:OneToVisibility x:Key="_OneToVisibility_" />
<views:PresenceStatus x:Key="_PresenceStatus_" />
<views:MoreThanOneToVisibility x:Key="_MoreThanOneToVisibility_" />
<views:MoreThanZeroToVisibility x:Key="_MoreThanZeroToVisibility_" />
<views:UnreadAccountNotificationsString x:Key="_UnreadAccountNotificationsString_" />
<views:PartialTrustToVisibility x:Key="_PartialTrustToVisibility_" />
<views:TrustedToVisibility x:Key="_TrustedToVisibility_" />
<views:SelectedAccountToVisibility x:Key="_SelectedAccountToVisibility_" />
<views:CallStatusToSpinnerVisibility x:Key="_CallStatusToSpinnerVisibility_" />
<views:CallStatusForIncomingCallEllipse x:Key="_CallStatusForIncomingCallEllipse_" />
<views:AccountRegistrationStateToString x:Key="_AccountRegistrationStateToString_" />
<views:AccountRegistrationStateToForeground x:Key="_AccountRegistrationStateToForeground_" />
<views:ContactAccountTypeToVisibility x:Key="_ContactAccountTypeToVisibility_" />
<views:ContactConferenceableToVisibility x:Key="_ContactConferenceableToVisibility_" />
<cnv:BubbleBackground x:Key="_bubbleBackground_" />
<cnv:BubbleHorizontalAlignement x:Key="_bubbleHorizontalAlignement_" />
<cnv:boolToVisibility x:Key="_boolToVisibility_" />
<cnv:MessageDateTimeString x:Key="_MessageDateTimeString_" />
<cnv:MessageChainBreakToVisibility x:Key="_MessageChainBreakToVisibility_" />
<cnv:MessageChainBreakToHeight x:Key="_MessageChainBreakToHeight_" />
<cnv:CachedImageConverter x:Key="_CachedImageConverter_" />
<cnv:NameToInitialConverter x:Key="_NameToInitialConverter_" />
<cnv:NewMessageBubbleNotification x:Key="_NewMessageBubbleNotification_" />
<cnv:NewMessageNotificationToNumber x:Key="_NewMessageNotificationToNumber_" />
<cnv:IncomingVisibility x:Key="_IncomingVisibility_" />
<cnv:OutGoingVisibility x:Key="_OutGoingVisibility_" />
<cnv:HasAnActiveCall x:Key="_HasAnActiveCall_" />
<cnv:HasAvatarToVisibility x:Key="_HasAvatarToVisibility_" />
<cnv:AccountTypeToSourceImage x:Key="_AccountTypeToSourceImage_" />
<cnv:RingAccountTypeToVisibility x:Key="_RingAccountTypeToVisibility_" />
<cnv:AccountSelectedToVisibility x:Key="_AccountSelectedToVisibility_" />
<cnv:CollapseEmptyString x:Key="_CollapseEmptyString_" />
<cnv:ContactStatusNotification x:Key="_ContactStatusNotification_" />
<cnv:uintToVisibility x:Key="_uintToVisibility_" />
<cnv:OneToVisibility x:Key="_OneToVisibility_" />
<cnv:PresenceStatus x:Key="_PresenceStatus_" />
<cnv:MoreThanOneToVisibility x:Key="_MoreThanOneToVisibility_" />
<cnv:MoreThanZeroToVisibility x:Key="_MoreThanZeroToVisibility_" />
<cnv:UnreadAccountNotificationsString x:Key="_UnreadAccountNotificationsString_" />
<cnv:PartialTrustToVisibility x:Key="_PartialTrustToVisibility_" />
<cnv:TrustedToVisibility x:Key="_TrustedToVisibility_" />
<cnv:SelectedAccountToVisibility x:Key="_SelectedAccountToVisibility_" />
<cnv:CallStatusToSpinnerVisibility x:Key="_CallStatusToSpinnerVisibility_" />
<cnv:CallStatusForIncomingCallEllipse x:Key="_CallStatusForIncomingCallEllipse_" />
<cnv:AccountRegistrationStateToString x:Key="_AccountRegistrationStateToString_" />
<cnv:AccountRegistrationStateToForeground x:Key="_AccountRegistrationStateToForeground_" />
<cnv:ContactAccountTypeToVisibility x:Key="_ContactAccountTypeToVisibility_" />
<cnv:ContactConferenceableToVisibility x:Key="_ContactConferenceableToVisibility_" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles.xaml"/>
......
This diff is collapsed.
This diff is collapsed.
......@@ -237,37 +237,6 @@ RingClientUWP::Views::MessageTextPage::sendMessage()
}
}
Object ^ RingClientUWP::Views::BubbleBackground::Convert(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
{
auto c1 = Utils::ColorFromString("#ffebefef");
auto c2 = Utils::ColorFromString("#ffcfebf5");
return ((bool)value) ? ref new SolidColorBrush(c1) : ref new SolidColorBrush(c2);
}
// we only do OneWay so the next function is not used
Object ^ RingClientUWP::Views::BubbleBackground::ConvertBack(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
{
throw ref new Platform::NotImplementedException();
}
RingClientUWP::Views::BubbleBackground::BubbleBackground()
{}
Object ^ RingClientUWP::Views::BubbleHorizontalAlignement::Convert(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
{
return ((bool)value) ? Windows::UI::Xaml::HorizontalAlignment::Left : Windows::UI::Xaml::HorizontalAlignment::Right;
}
// we only do OneWay so the next function is not used
Object ^ RingClientUWP::Views::BubbleHorizontalAlignement::ConvertBack(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
{
throw ref new Platform::NotImplementedException();
}
RingClientUWP::Views::BubbleHorizontalAlignement::BubbleHorizontalAlignement()
{}
void RingClientUWP::Views::MessageTextPage::OnincomingMessage(Platform::String ^callId, Platform::String ^payload)
{
scrollDown();
......
......@@ -28,20 +28,6 @@ delegate void CloseMessageTextPage();
namespace Views
{
public ref class BubbleBackground sealed : IValueConverter {
public:
virtual Object^ Convert(Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object^ parameter, String^ language);
virtual Object^ ConvertBack(Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object^ parameter, String^ language);
BubbleBackground();
};
public ref class BubbleHorizontalAlignement sealed : IValueConverter {
public:
virtual Object^ Convert(Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object^ parameter, String^ language);
virtual Object^ ConvertBack(Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object^ parameter, String^ language);
BubbleHorizontalAlignement();
};
public ref class MessageTextPage sealed
{
public:
......
This diff is collapsed.
This diff is collapsed.
......@@ -56,6 +56,7 @@
#include "UserPreferences.h"
#include "VCardUtils.h"
#include "ResourceManager.h"
#include "Converters.h"
/* video */
#include "Video.h"
......
......@@ -182,6 +182,7 @@
<ClInclude Include="ContactRequestItemsViewModel.h" />
<ClInclude Include="ContactListModel.h" />
<ClInclude Include="Conversation.h" />
<ClInclude Include="Converters.h" />
<ClInclude Include="HttpUtils.h" />
<ClInclude Include="RingDevice.h" />
<ClInclude Include="RingDeviceItemsViewModel.h" />
......@@ -195,7 +196,7 @@
<DependentUpon>MessageTextPage.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="pch.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="App.xaml.h">
<DependentUpon>App.xaml</DependentUpon>
......@@ -367,6 +368,7 @@
<ClCompile Include="ContactRequestItemsViewModel.cpp" />
<ClCompile Include="ContactListModel.cpp" />
<ClCompile Include="Conversation.cpp" />
<ClCompile Include="Converters.cpp" />
<ClCompile Include="RingDeviceItemsViewModel.cpp" />
<ClCompile Include="RingDeviceItem.cpp" />
<ClCompile Include="LoadingPage.xaml.cpp">
......
......@@ -94,6 +94,9 @@
<ClCompile Include="RingDeviceItem.cpp">
<Filter>Controls</Filter>
</ClCompile>
<ClCompile Include="Converters.cpp">
<Filter>Common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="LoadingPage.xaml.h" />
......@@ -202,6 +205,9 @@
<ClInclude Include="HttpUtils.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Converters.h">
<Filter>Common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Assets\AccountTypeRING.png">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment