Open KNGCoder opened 11 months ago
Следущая задача с графикой. Гуглим
14 вопрос с 3D графикой https://www.codeproject.com/Tips/882885/Display-D-Model-using-Window-Presentation-Foundat
22 и 28 вопрос получение данных с микрофона https://www.codeproject.com/Articles/19854/Sending-and-playing-microphone-audio-over-network
28 вопрос получение данных с камеры https://github.com/castorix/WinUI3_DirectShow_Capture
13 вопрос сериализация https://learn.microsoft.com/ru-ru/dotnet/standard/serialization/system-text-json/how-to
<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800">
<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800">
public partial class MainWindow : Window { private ListBoxItem dragSource;
public MainWindow()
{
InitializeComponent();
}
private void ListBox_PreviewMouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed && sender is ListBox listBox)
{
var point = e.GetPosition(listBox);
var hitResult = VisualTreeHelper.HitTest(listBox, point);
if (hitResult != null)
{
dragSource = hitResult.VisualHit as ListBoxItem;
}
}
}
private void ListBox_Drop(object sender, DragEventArgs e)
{
if (sender is ListBox listBox && dragSource != null)
{
var point = e.GetPosition(listBox);
var hitResult = VisualTreeHelper.HitTest(listBox, point);
if (hitResult != null && hitResult.VisualHit is ListBoxItem target)
{
var sourceIndex = listBox.Items.IndexOf(dragSource.Content);
var targetIndex = listBox.Items.IndexOf(target.Content);
listBox.Items.Remove(dragSource.Content);
listBox.Items.Insert(targetIndex, dragSource.Content);
}
}
}
}
<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800">
public partial class MainWindow : Window { private ListBoxItem dragSource;
public MainWindow()
{
InitializeComponent();
}
private void ListBox_PreviewMouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed && sender is ListBox listBox)
{
var point = e.GetPosition(listBox);
var hitResult = VisualTreeHelper.HitTest(listBox, point);
if (hitResult != null)
{
dragSource = hitResult.VisualHit as ListBoxItem;
}
}
}
private void ListBox_Drop(object sender, DragEventArgs e)
{
if (sender is ListBox listBox && dragSource != null)
{
var point = e.GetPosition(listBox);
var hitResult = VisualTreeHelper.HitTest(listBox, point);
if (hitResult != null && hitResult.VisualHit is ListBoxItem target)
{
var sourceIndex = listBox.Items.IndexOf(dragSource.Content);
var targetIndex = listBox.Items.IndexOf(target.Content);
listBox.Items.Remove(dragSource.Content);
listBox.Items.Insert(targetIndex, dragSource.Content);
}
}
}
}
<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800">
пишите новые номера задач . начали с 13 номера