Click here to Skip to main content
15,884,892 members
Articles / Programming Languages / C#

Windows 7: New Features Explained using .NET

Rate me:
Please Sign up or sign in to vote.
4.65/5 (78 votes)
29 Mar 2021CPOL18 min read 186.1K   10K   263  
New Win7 features explained with simple demo applications
In this article, new Windows 7 features like Jumplist, Taskbar Progressbar, Tabbed Thumbnail, Icon Overlays, Application Restart Data Recovery, Network Management, Power Management, Task dialog, Sensor API, etc. are explained with simple demo applications
<Window x:Class="PictureViewerDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="View Your Pictures" Height="350" Width="525" Background="Gray"
        WindowState="Maximized">
    <DockPanel>
        <DockPanel.Resources>
            <ResourceDictionary Source="DictResources.xaml"></ResourceDictionary>
        </DockPanel.Resources>
        <StackPanel FlowDirection="LeftToRight"  Orientation="Horizontal" DockPanel.Dock="Top" VerticalAlignment="Center" HorizontalAlignment="Center">
            <Label Style="{StaticResource CurrentLabel}" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center">
                Current File
            </Label>
            <Label  Style="{StaticResource CurrentLabel}" Margin="5,0,0,0" Name="FileNameLabel" Width="300"  VerticalAlignment="Center" HorizontalAlignment="Center"/>
            <Button Style="{StaticResource blue_btn}" Margin="5,0,0,0" Height="23" Name="BrowseButton" Width="75" Click="BrowseButton_Click">
                Browse
            </Button>
            <Button Style="{StaticResource blue_btn}" Margin="5,0,0,0" Height="23" Name="SearchButton" Width="75" Click="SearchButton_Click">
                Search
            </Button>
            <Button Style="{StaticResource blue_btn}" Margin="5,0,0,0" Height="23" Name="SaveButton" Width="75" Click="SaveButton_Click">
                Save
            </Button>
        </StackPanel>
        <ListBox 
              Name="ImageList" 
              DockPanel.Dock="Bottom" 
              Style="{StaticResource ProjectListBoxStyle}"
              ItemsSource="{Binding Images}" 
              ItemTemplate="{StaticResource MyImageTemplate}" Height="140" SelectionChanged="ImageList_SelectionChanged">

            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="stImages">
                    </StackPanel>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
        <!--<Expander DockPanel.Dock="Right" >
            <WrapPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="stImages">
                <Button Style="{StaticResource blue_btn}" Margin="5,0,0,0" Height="23" Name="AddButton" Width="75" Click="BrowseButton_Click">
                    Search
                </Button>
                <ListBox x:Name="lstLibrary"
                         ItemTemplate="{StaticResource MyMRUTemplate}" ItemsSource="{Binding AllPackages}">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical">
                            </StackPanel>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
            </WrapPanel>

        </Expander>-->
        <Slider Name="AngleSlider" DockPanel.Dock="Bottom" Height="20" Minimum="0" Maximum="180" 
                RenderTransformOrigin="0.501,0.622" Margin="81,161.66,66,0">
            <Slider.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="-1" ScaleY="-1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="179.863"/>
                    <TranslateTransform X="-0.954" Y="-9.028"/>
                </TransformGroup>
            </Slider.RenderTransform>
            <Slider.Background>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#ccffffff" Offset="0"/>
                    <GradientStop Color="Transparent" Offset="1"/>
                </LinearGradientBrush>
            </Slider.Background>
        </Slider>
        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">

            <Border BorderBrush="White" BorderThickness="0" 
                HorizontalAlignment="Right"  VerticalAlignment="Center" Width="500" Height="400">
                <Image Source="{Binding ElementName=ImageList,Path=SelectedItem.Image}" x:Name="Imgdisplay">
                    <Image.LayoutTransform>
                        <SkewTransform AngleX="{Binding ElementName=AngleSlider, Path=Value}" />
                    </Image.LayoutTransform>
                    <Image.Effect>
                        <DropShadowEffect Opacity="4" ></DropShadowEffect>
                    </Image.Effect>
                </Image>
            </Border>
            <!--<Border Width="210" HorizontalAlignment="Left">
                <Border.Background>
                    <VisualBrush Visual="{Binding ElementName=Imgdisplay}">
                        <VisualBrush.Transform>
                            <ScaleTransform ScaleX="1" ScaleY="1" CenterX="200" CenterY="150"></ScaleTransform>
                        </VisualBrush.Transform>
                    </VisualBrush>
                </Border.Background>
                <Border.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                        <GradientStop Offset="0" Color="Black"></GradientStop>
                        <GradientStop Offset="0.6" Color="Transparent"></GradientStop>
                    </LinearGradientBrush>
                </Border.OpacityMask>
            </Border>-->

            <TextBox Text="{Binding ElementName=ImageList, Path=SelectedItem.Comment}" x:Name="txtComments">
                <TextBox.Style>
                    <Style TargetType="{x:Type TextBox}">
                       <Style.Triggers>
                            <DataTrigger Binding="{Binding ElementName=ImageList, Path=SelectedItem}" Value="True">
                                <Setter Property="Visibility" Value="Hidden"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
                <!--<TextBox.Triggers>
                    <Trigger>
                        <Setter Property="Visibility" Value="Visible"></Setter>
                    </Trigger>
                </TextBox.Triggers>-->
            </TextBox>
        </StackPanel>

    </DockPanel>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
President
India India
Did you like his post?

Oh, lets go a bit further to know him better.
Visit his Website : www.abhisheksur.com to know more about Abhishek.

Abhishek also authored a book on .NET 4.5 Features and recommends you to read it, you will learn a lot from it.
http://bit.ly/EXPERTCookBook

Basically he is from India, who loves to explore the .NET world. He loves to code and in his leisure you always find him talking about technical stuffs.

Working as a VP product of APPSeCONNECT, an integration platform of future, he does all sort of innovation around the product.

Have any problem? Write to him in his Forum.

You can also mail him directly to abhi2434@yahoo.com

Want a Coder like him for your project?
Drop him a mail to contact@abhisheksur.com

Visit His Blog

Dotnet Tricks and Tips



Dont forget to vote or share your comments about his Writing

Comments and Discussions