نوشته شده توسط
Mori Bone
wpf و xaml از زمان ویندوز ویستا و نت فرمورک 3.5 پابر جاس و میشه این فناوری روبر پایه 3.5 هم نوشت
سلام
مطمئن باش پشیمون نمیشی صادقانه میگم حدود 4 ساله wpf کار می کنم و جز یکی دو ماه اول هیچ وقت به فکر winform نیفتادم
چند نمونه
ZipArchive Class و ZipFile Class از فضای System.IO.Compression فقط در 4.5 و 4.6 وجود داره
بعنوان مثال به این آدرس برو
https://msdn.microsoft.com/en-us/lib...vs.110%29.aspx
مقایسه System.IO.Compression در 4 و 4.5
https://msdn.microsoft.com/en-us/lib...vs.100%29.aspx
System.IO.Compression Namespace
.NET Framework 4
The System.IO.Compression namespace contains classes that provide basic compression and decompression services for streams.
Classes
Public class DeflateStream Provides methods and properties for compressing and decompressing streams using the Deflate algorithm.
Public class GZipStream Provides methods and properties used to compress and decompress streams.
Enumerations
CompressionMode Specifies whether to compress or decompress the underlying stream.
.NET Framework 4.6 and 4.5
The System.IO.Compression namespace contains classes that provide basic compression and decompression services for streams.
Public class Supported by Portable Class Library DeflateStream Provides methods and properties for compressing and decompressing streams by using the Deflate algorithm.
Public class Supported by Portable Class Library GZipStream Provides methods and properties used to compress and decompress streams.
Public class ZipArchive Represents a package of compressed files in the zip archive format.
Public class ZipArchiveEntry Represents a compressed file within a zip archive.
Public class ZipFile Provides static methods for creating, extracting, and opening zip archives.
Public class ZipFileExtensions Provides extension methods for the ZipArchive and ZipArchiveEntry classes.
Enumerations
Public enumeration CompressionLevel Specifies values that indicate whether a compression operation emphasizes speed or compression size.
Public enumeration Supported by Portable Class Library CompressionMode Specifies whether to compress or decompress the underlying stream.
Public enumeration ZipArchiveMode Specifies values for interacting
عکس زیر هم یک listbox هستش که داخلش از دو تا Textblock استفاده شده و بعنوان منو بکار برده شده و موس در لحظه عکس گرفتن روی اضافه کردن بوده
1.png
اینم کدش
<ListBox Name="list" Margin="2" ItemsSource="{Binding}" VerticalAlignment="Stretch"
Grid.RowSpan="11" Width="Auto" HorizontalAlignment="Stretch" MouseLeftButtonUp="list_MouseLeftButtonUp">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Titl_Menu}" FontWeight="Bold" FontSize="14" Foreground="YellowGreen"/>
<TextBlock Text="{Binding Path=Discription_Menu}" FontStyle="Italic" FontSize="11" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
مثال بالا با اضافه شدن عکس به هر سطر listbox
2.png
<ListBox Name="list" Margin="2" ItemsSource="{Binding}" VerticalAlignment="Stretch"
Grid.RowSpan="11" Width="Auto" HorizontalAlignment="Stretch" MouseLeftButtonUp="list_MouseLeftButtonUp">
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<Image Name="image2" Stretch="Fill" Width="100" Source="{Binding Path=Pic_Menu}" Height="40" />
<StackPanel>
<TextBlock Text="{Binding Path=Titl_Menu}" FontWeight="Bold" FontSize="14" Foreground="YellowGreen"/>
<TextBlock Text="{Binding Path=Discription_Menu}" FontStyle="Italic" FontSize="11" />
</StackPanel>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>