aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml
blob: e79696a55288a1323a877e674f5012b083460884 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<UserControl x:Class="Tango.PPC.Common.Notifications.NotificationItems.MessageNotificationItemView"
             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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:local="clr-namespace:Tango.PPC.Common.Notifications.NotificationItems"
             xmlns:common="clr-namespace:Tango.PPC.Common.Converters"
             mc:Ignorable="d" 
             x:Name="MessageNotificationItemControl"
             d:DesignHeight="60" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:MessageNotificationItem, IsDesignTimeCreatable=False}" MinHeight="90" Height="90" MaxHeight="150" Background="White">

    <UserControl.Resources>
        <common:HeightToOpacityConverter x:Key="heightToOpacityConverter" />
    </UserControl.Resources>
    <Grid>
        <Border BorderThickness="0 0 0 2">
            <Border.Style>
                <Style TargetType="Border">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding MessageType}" Value="Info">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource TangoPrimaryAccentColor}" Opacity="0.2"></SolidColorBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Success">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource TangoSuccessColor}" Opacity="0.2"></SolidColorBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="{StaticResource TangoSuccessBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Warning">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource TangoWarningColor}" Opacity="0.2"></SolidColorBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="{StaticResource TangoWarningBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Error">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource TangoErrorColor}" Opacity="0.2"></SolidColorBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Critical">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource TangoErrorColor}" Opacity="0.2"></SolidColorBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
        </Border>
        <ContentControl>
            <ContentControl.Style>
                <Style TargetType="ContentControl">
                    <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding MessageType}" Value="Info">
                            <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Success">
                            <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Warning">
                            <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Error">
                            <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageType}" Value="Critical">
                            <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ContentControl.Style>
            <DockPanel>
                <touch:TouchIcon Margin="15" DockPanel.Dock="Left" MaxHeight="40">
                    <touch:TouchIcon.Style>
                        <Style TargetType="touch:TouchIcon">
                            <Setter Property="Icon" Value="Information"></Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding MessageType}" Value="Info">
                                    <Setter Property="Icon" Value="Information"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding MessageType}" Value="Success">
                                    <Setter Property="Icon" Value="Check"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding MessageType}" Value="Warning">
                                    <Setter Property="Icon" Value="AlertCircleOutline"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding MessageType}" Value="Error">
                                    <Setter Property="Icon" Value="AlertCircleOutline"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding MessageType}" Value="Critical">
                                    <Setter Property="Icon" Value="Alert"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </touch:TouchIcon.Style>
                </touch:TouchIcon>

                <StackPanel Margin="10 0 0 0" VerticalAlignment="Center">
                    <TextBlock Text="{Binding Message}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Foreground="Black" VerticalAlignment="Center" ></TextBlock>

                    <Canvas Margin="0 5 0 0">
                        <TextBlock Foreground="{StaticResource TangoDarkForegroundBrush}" Text="{Binding ExpandedMessage}" TextWrapping="Wrap" VerticalAlignment="Center">
                            <TextBlock.Opacity>
                                <MultiBinding Converter="{StaticResource heightToOpacityConverter}">
                                    <Binding Path="ActualHeight" ElementName="MessageNotificationItemControl" />
                                    <Binding Path="MinHeight" ElementName="MessageNotificationItemControl" />
                                    <Binding Path="MaxHeight" ElementName="MessageNotificationItemControl" />
                                </MultiBinding>
                            </TextBlock.Opacity>
                        </TextBlock>
                    </Canvas>
                </StackPanel>
            </DockPanel>
        </ContentControl>
    </Grid>
</UserControl>
s="w"> <google/protobuf/wire_format.h> // @@protoc_insertion_point(includes) namespace Tango { namespace PMR { namespace Diagnostics { class DoubleArrayDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed<DoubleArray> _instance; } _DoubleArray_default_instance_; namespace protobuf_DoubleArray_2eproto { namespace { ::google::protobuf::Metadata file_level_metadata[1]; } // namespace PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, }; PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ::google::protobuf::internal::AuxillaryParseTableField(), }; PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, }; const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleArray, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleArray, data_), }; static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(DoubleArray)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { reinterpret_cast<const ::google::protobuf::Message*>(&_DoubleArray_default_instance_), }; namespace { void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( "DoubleArray.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } void protobuf_AssignDescriptorsOnce() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } } // namespace void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _DoubleArray_default_instance_._instance.DefaultConstruct(); ::google::protobuf::internal::OnShutdownDestroyMessage( &_DoubleArray_default_instance_);} void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\021DoubleArray.proto\022\025Tango.PMR.Diagnosti" "cs\"\033\n\013DoubleArray\022\014\n\004Data\030\001 \003(\001B!\n\037com.t" "wine.tango.pmr.diagnosticsb\006proto3" }; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( descriptor, 114); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "DoubleArray.proto", &protobuf_RegisterTypes); } } // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); } } static_descriptor_initializer; } // namespace protobuf_DoubleArray_2eproto // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int DoubleArray::kDataFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 DoubleArray::DoubleArray() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { protobuf_DoubleArray_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:Tango.PMR.Diagnostics.DoubleArray) } DoubleArray::DoubleArray(const DoubleArray& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), data_(from.data_), _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:Tango.PMR.Diagnostics.DoubleArray) } void DoubleArray::SharedCtor() { _cached_size_ = 0; } DoubleArray::~DoubleArray() { // @@protoc_insertion_point(destructor:Tango.PMR.Diagnostics.DoubleArray) SharedDtor(); } void DoubleArray::SharedDtor() { } void DoubleArray::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DoubleArray::descriptor() { protobuf_DoubleArray_2eproto::protobuf_AssignDescriptorsOnce(); return protobuf_DoubleArray_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const DoubleArray& DoubleArray::default_instance() { protobuf_DoubleArray_2eproto::InitDefaults(); return *internal_default_instance(); } DoubleArray* DoubleArray::New(::google::protobuf::Arena* arena) const { DoubleArray* n = new DoubleArray; if (arena != NULL) { arena->Own(n); } return n; } void DoubleArray::Clear() { // @@protoc_insertion_point(message_clear_start:Tango.PMR.Diagnostics.DoubleArray) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; data_.Clear(); _internal_metadata_.Clear(); } bool DoubleArray::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:Tango.PMR.Diagnostics.DoubleArray) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated double Data = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, this->mutable_data()))); } else if ( static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( 1, 10u, input, this->mutable_data()))); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:Tango.PMR.Diagnostics.DoubleArray) return true; failure: // @@protoc_insertion_point(parse_failure:Tango.PMR.Diagnostics.DoubleArray) return false; #undef DO_ } void DoubleArray::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:Tango.PMR.Diagnostics.DoubleArray) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated double Data = 1; if (this->data_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(static_cast< ::google::protobuf::uint32>( _data_cached_byte_size_)); ::google::protobuf::internal::WireFormatLite::WriteDoubleArray( this->data().data(), this->data_size(), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@protoc_insertion_point(serialize_end:Tango.PMR.Diagnostics.DoubleArray) } ::google::protobuf::uint8* DoubleArray::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:Tango.PMR.Diagnostics.DoubleArray) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated double Data = 1; if (this->data_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>( _data_cached_byte_size_), target); target = ::google::protobuf::internal::WireFormatLite:: WriteDoubleNoTagToArray(this->data_, target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@protoc_insertion_point(serialize_to_array_end:Tango.PMR.Diagnostics.DoubleArray) return target; } size_t DoubleArray::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:Tango.PMR.Diagnostics.DoubleArray) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // repeated double Data = 1; { unsigned int count = static_cast<unsigned int>(this->data_size()); size_t data_size = 8UL * count; if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( static_cast< ::google::protobuf::int32>(data_size)); } int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _data_cached_byte_size_ = cached_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void DoubleArray::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:Tango.PMR.Diagnostics.DoubleArray) GOOGLE_DCHECK_NE(&from, this); const DoubleArray* source = ::google::protobuf::internal::DynamicCastToGenerated<const DoubleArray>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:Tango.PMR.Diagnostics.DoubleArray) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:Tango.PMR.Diagnostics.DoubleArray) MergeFrom(*source); } } void DoubleArray::MergeFrom(const DoubleArray& from) { // @@protoc_insertion_point(class_specific_merge_from_start:Tango.PMR.Diagnostics.DoubleArray) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; data_.MergeFrom(from.data_); } void DoubleArray::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:Tango.PMR.Diagnostics.DoubleArray) if (&from == this) return; Clear(); MergeFrom(from); } void DoubleArray::CopyFrom(const DoubleArray& from) { // @@protoc_insertion_point(class_specific_copy_from_start:Tango.PMR.Diagnostics.DoubleArray) if (&from == this) return; Clear(); MergeFrom(from); } bool DoubleArray::IsInitialized() const { return true; } void DoubleArray::Swap(DoubleArray* other) { if (other == this) return; InternalSwap(other); } void DoubleArray::InternalSwap(DoubleArray* other) { using std::swap; data_.InternalSwap(&other->data_); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata DoubleArray::GetMetadata() const { protobuf_DoubleArray_2eproto::protobuf_AssignDescriptorsOnce(); return protobuf_DoubleArray_2eproto::file_level_metadata[kIndexInFileMessages]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // DoubleArray // repeated double Data = 1; int DoubleArray::data_size() const { return data_.size(); } void DoubleArray::clear_data() { data_.Clear(); } double DoubleArray::data(int index) const { // @@protoc_insertion_point(field_get:Tango.PMR.Diagnostics.DoubleArray.Data) return data_.Get(index); } void DoubleArray::set_data(int index, double value) { data_.Set(index, value); // @@protoc_insertion_point(field_set:Tango.PMR.Diagnostics.DoubleArray.Data) } void DoubleArray::add_data(double value) { data_.Add(value); // @@protoc_insertion_point(field_add:Tango.PMR.Diagnostics.DoubleArray.Data) } const ::google::protobuf::RepeatedField< double >& DoubleArray::data() const { // @@protoc_insertion_point(field_list:Tango.PMR.Diagnostics.DoubleArray.Data) return data_; } ::google::protobuf::RepeatedField< double >* DoubleArray::mutable_data() { // @@protoc_insertion_point(field_mutable_list:Tango.PMR.Diagnostics.DoubleArray.Data) return &data_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace Diagnostics } // namespace PMR } // namespace Tango // @@protoc_insertion_point(global_scope)