Commit aaa9c910 authored by Greg Pettyjohn's avatar Greg Pettyjohn
Browse files

Added a bunch of finishing touches

parent 46cabd4c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,6 @@
             xmlns:local="clr-namespace:DeviceLab"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
         
        <ResourceDictionary Source="Themes\CustomStyles.xaml" />
    </Application.Resources>
</Application>
+1 −7
Original line number Diff line number Diff line
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;

namespace DeviceLab
{
+25 −0
Original line number Diff line number Diff line
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace DeviceLab
{
    public class AutoScrollTextBox : TextBox
    {
        static AutoScrollTextBox()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(AutoScrollTextBox), new FrameworkPropertyMetadata(typeof(AutoScrollTextBox)));
        }

        protected override void OnTextChanged(TextChangedEventArgs e)
        {
            base.OnTextChanged(e);
            CaretIndex = Text.Length;
            ScrollToEnd();
        }
    }
}
+6 −37
Original line number Diff line number Diff line
@@ -123,42 +123,6 @@
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>

                    <!--<ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <Border x:Name="Bd"
                                MouseDown="EatMouseClicks"
                                BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsMouseOver" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.MouseOver.Background}"/>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.MouseOver.Border}"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="Selector.IsSelectionActive" Value="False"/>
                                    <Condition Property="IsSelected" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="Selector.IsSelectionActive" Value="True"/>
                                    <Condition Property="IsSelected" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>-->
                </Setter.Value>
            </Setter>
        </Style>
@@ -171,6 +135,10 @@
                            <TextBox Width="100" Margin="0,0,4,0" Text="{Binding DeviceNameEntry, UpdateSourceTrigger=PropertyChanged}" />
                            <Button Padding="2,1,2,1" Command="{Binding RenameCommand}" Content="Rename" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <Button Content="Reboot" Width="60" Command="{Binding RebootCommand}" />
                            <Button Content="Reestablish Connection" Width="140" Margin="2,0,0,0" Command="{Binding ReestablishConnectionCommand}" />
                        </StackPanel>
                    </StackPanel>
                </TabItem>
                <TabItem Header="Info">
@@ -251,8 +219,9 @@
    </UserControl.Resources>
    <local:SelectionListBox
        SelectionMode="Multiple"
        ScrollViewer.CanContentScroll="False"
        ItemsSource="{Binding ConnectedDevices}"
        ItemContainerStyle="{DynamicResource DeviceCollectionItemStyle}"
        ItemTemplate="{DynamicResource DevicePortalView}"
        SelectionList="{Binding SelectedDevices}" />
        SelectionList="{Binding SelectedDevices, Mode=TwoWay}" />
</UserControl>
+5 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Compile Include="AutoScrollTextBox.cs" />
    <Compile Include="DeviceCollectionView.xaml.cs">
      <DependentUpon>DeviceCollectionView.xaml</DependentUpon>
    </Compile>
@@ -98,6 +99,10 @@
      <DependentUpon>MainWindow.xaml</DependentUpon>
      <SubType>Code</SubType>
    </Compile>
    <Page Include="Themes\CustomStyles.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Themes\Generic.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
Loading