aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/Views/SitesView.xaml
blob: 437003a8a90251a76f3afb2cc367eff85d66ba68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<UserControl x:Class="Tango.MachineStudio.Sites.Views.SitesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Tango.MachineStudio.Sites.Views"
             xmlns:vm="clr-namespace:Tango.MachineStudio.Sites.ViewModels"
             xmlns:global="clr-namespace:Tango.MachineStudio.Sites"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
    <UserControl.Resources>
        <converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" />
    </UserControl.Resources>

    <Grid>
        <DockPanel Margin="100" MaxWidth="1200">
            <Grid DockPanel.Dock="Top">
                <StackPanel Orientation="Horizontal">
                    <Image  Source="../Images/machine_site.png" Width="350" RenderOptions.BitmapScalingMode="Fant" Margin="10" />

                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Margin="0 0 0 10">
                        <materialDesign:PackIcon VerticalAlignment="Center" Kind="Magnify" Width="32" Height="32" />
                        <TextBox Width="400" FontSize="20" Margin="10 0 0 0" materialDesign:HintAssist.Hint="Name, Organization" Text="{Binding Filter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                    </StackPanel>
                </StackPanel>
            </Grid>
            <Grid DockPanel.Dock="Bottom" IsEnabled="{Binding IsFree}">
                <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0">
                    <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveSiteCommand}">
                        <StackPanel Orientation="Horizontal">
                            <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" />
                            <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock>
                        </StackPanel>
                    </Button>
                    <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddSiteCommand}">
                        <StackPanel Orientation="Horizontal">
                            <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" />
                            <TextBlock Margin="5 0 0 0" FontSize="16">NEW SITE</TextBlock>
                        </StackPanel>
                    </Button>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Margin="50 0 0 0" MinWidth="200" Height="60" Command="{Binding ManageSiteCommand}">
                        <StackPanel Orientation="Horizontal">
                            <materialDesign:PackIcon Kind="Pencil" Width="24" Height="24" />
                            <TextBlock Margin="10 0 0 0" FontSize="18">EDIT</TextBlock>
                        </StackPanel>
                    </Button>
                </StackPanel>
            </Grid>
            <Grid IsEnabled="{Binding IsFree}">
                <controls:DoubleClickDataGrid Style="{StaticResource {x:Type DataGrid}}" DoubleClickCommand="{Binding ManageSiteCommand}" Margin="0 0 0 10" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Sites}" SelectedItem="{Binding SelectedSite}">
                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
                            <Setter Property="BorderThickness" Value="0"/>
                            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                            <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
                        </Style>
                    </DataGrid.CellStyle>
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="NAME" Binding="{Binding Name}" Width="Auto" />
                        <DataGridTextColumn Header="DESCRIPTION" Binding="{Binding Description}" Width="Auto" />
                        <DataGridTextColumn Header="ORGANIZATION" Binding="{Binding Organization}" Width="Auto" />
                        <DataGridTextColumn Header="MACHINES" Binding="{Binding MachineCount}" Width="Auto" />
                        <DataGridTextColumn Header="THREADS" Binding="{Binding ThreadCount}" Width="Auto" />
                        <DataGridTextColumn Header="CATALOGS" Binding="{Binding CatalogCount}" Width="Auto" />
                        <DataGridTextColumn Header="LAST UPDATED" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="1*" />
                    </DataGrid.Columns>
                </controls:DoubleClickDataGrid>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>
class="n">ConnectResponse; class ConnectResponseDefaultTypeInternal; extern ConnectResponseDefaultTypeInternal _ConnectResponse_default_instance_; } // namespace Connection } // namespace PMR } // namespace Tango namespace Tango { namespace PMR { namespace Connection { namespace protobuf_ConnectResponse_2eproto { // Internal implementation detail -- do not call these. struct TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; static const ::google::protobuf::internal::ParseTable schema[]; static const ::google::protobuf::uint32 offsets[]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; static void InitDefaultsImpl(); }; void AddDescriptors(); void InitDefaults(); } // namespace protobuf_ConnectResponse_2eproto // =================================================================== class ConnectResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Tango.PMR.Connection.ConnectResponse) */ { public: ConnectResponse(); virtual ~ConnectResponse(); ConnectResponse(const ConnectResponse& from); inline ConnectResponse& operator=(const ConnectResponse& from) { CopyFrom(from); return *this; } #if LANG_CXX11 ConnectResponse(ConnectResponse&& from) noexcept : ConnectResponse() { *this = ::std::move(from); } inline ConnectResponse& operator=(ConnectResponse&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif static const ::google::protobuf::Descriptor* descriptor(); static const ConnectResponse& default_instance(); static inline const ConnectResponse* internal_default_instance() { return reinterpret_cast<const ConnectResponse*>( &_ConnectResponse_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0; void Swap(ConnectResponse* other); friend void swap(ConnectResponse& a, ConnectResponse& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline ConnectResponse* New() const PROTOBUF_FINAL { return New(NULL); } ConnectResponse* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const ConnectResponse& from); void MergeFrom(const ConnectResponse& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ConnectResponse* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return NULL; } inline void* MaybeArenaPtr() const { return NULL; } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // .Tango.PMR.Connection.DeviceInformation DeviceInformation = 1; bool has_deviceinformation() const; void clear_deviceinformation(); static const int kDeviceInformationFieldNumber = 1; const ::Tango::PMR::Connection::DeviceInformation& deviceinformation() const; ::Tango::PMR::Connection::DeviceInformation* mutable_deviceinformation(); ::Tango::PMR::Connection::DeviceInformation* release_deviceinformation(); void set_allocated_deviceinformation(::Tango::PMR::Connection::DeviceInformation* deviceinformation); // @@protoc_insertion_point(class_scope:Tango.PMR.Connection.ConnectResponse) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::Tango::PMR::Connection::DeviceInformation* deviceinformation_; mutable int _cached_size_; friend struct protobuf_ConnectResponse_2eproto::TableStruct; }; // =================================================================== // =================================================================== #if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ // ConnectResponse // .Tango.PMR.Connection.DeviceInformation DeviceInformation = 1; inline bool ConnectResponse::has_deviceinformation() const { return this != internal_default_instance() && deviceinformation_ != NULL; } inline void ConnectResponse::clear_deviceinformation() { if (GetArenaNoVirtual() == NULL && deviceinformation_ != NULL) delete deviceinformation_; deviceinformation_ = NULL; } inline const ::Tango::PMR::Connection::DeviceInformation& ConnectResponse::deviceinformation() const { const ::Tango::PMR::Connection::DeviceInformation* p = deviceinformation_; // @@protoc_insertion_point(field_get:Tango.PMR.Connection.ConnectResponse.DeviceInformation) return p != NULL ? *p : *reinterpret_cast<const ::Tango::PMR::Connection::DeviceInformation*>( &::Tango::PMR::Connection::_DeviceInformation_default_instance_); } inline ::Tango::PMR::Connection::DeviceInformation* ConnectResponse::mutable_deviceinformation() { if (deviceinformation_ == NULL) { deviceinformation_ = new ::Tango::PMR::Connection::DeviceInformation; } // @@protoc_insertion_point(field_mutable:Tango.PMR.Connection.ConnectResponse.DeviceInformation) return deviceinformation_; } inline ::Tango::PMR::Connection::DeviceInformation* ConnectResponse::release_deviceinformation() { // @@protoc_insertion_point(field_release:Tango.PMR.Connection.ConnectResponse.DeviceInformation) ::Tango::PMR::Connection::DeviceInformation* temp = deviceinformation_; deviceinformation_ = NULL; return temp; } inline void ConnectResponse::set_allocated_deviceinformation(::Tango::PMR::Connection::DeviceInformation* deviceinformation) { delete deviceinformation_; deviceinformation_ = deviceinformation; if (deviceinformation) { } else { } // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Connection.ConnectResponse.DeviceInformation) } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace Connection } // namespace PMR } // namespace Tango // @@protoc_insertion_point(global_scope) #endif // PROTOBUF_ConnectResponse_2eproto__INCLUDED