Skip to content

Commit

Permalink
Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodrigv committed Apr 18, 2021
1 parent 43171fe commit ae334ff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OfCourseIStillLoveYou.DesktopClient/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
Title="OfCourseIStillLoveYou.DesktopClient">


<Panel Background="Black">
<Image Name="imgCameraTexture" Stretch="Uniform" Source="/Assets/OfCourseIStillLoveYou.png" ClipToBounds="true" ></Image>
<Panel Background="Black" >
<Image Name="imgCameraTexture" Stretch="Uniform" Source="/Assets/OfCourseIStillLoveYou.png" ClipToBounds="true" DoubleTapped="ImgCameraTexture_OnDoubleTapped"></Image>
<DockPanel Margin="10" ClipToBounds="True" >
<Label Content="SELECT A CAMERA" Foreground="White" FontSize="14" FontFamily="Calibri" FontWeight="400"></Label>
<Label Name="labelCameras" Content="SELECT A CAMERA" Foreground="White" FontSize="14" FontFamily="Calibri" FontWeight="400"></Label>
<ComboBox Name="cbCameras" Margin="5,0,0,0" MinWidth="150"></ComboBox>
</DockPanel>

Expand Down
17 changes: 17 additions & 0 deletions OfCourseIStillLoveYou.DesktopClient/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Media.Imaging;
using Avalonia.Threading;
Expand Down Expand Up @@ -191,5 +193,20 @@ private void UpdateCameraList(List<string?> cameraIds)
}

}

private void ImgCameraTexture_OnDoubleTapped(object? sender, RoutedEventArgs e)
{

Dispatcher.UIThread.InvokeAsync(() =>
{
var textInfo = this.FindControl<TextBlock>("TextInfo");
var cbCameras = this.FindControl<ComboBox>("cbCameras");
var labelCameras = this.FindControl<Label>("labelCameras");
labelCameras.IsVisible = !labelCameras.IsVisible;
textInfo.IsVisible = !textInfo.IsVisible;
cbCameras.IsVisible = !cbCameras.IsVisible;
});
}
}
}

0 comments on commit ae334ff

Please sign in to comment.