.NET MAUI Course for Beginners – Create Cross-Platform Apps with C#
Learn how to use .NET MAUI for native cross-platform desktop and mobile development! You will learn the essentials of building mobile applications with .NET MAUI and C# while creating a Contacts app.
⭐️ Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:03:42) What is .Net Maui - .Net Maui vs Xamarin Forms
⌨️ (0:06:52) Prepare Development Environment _ Create first project
⌨️ (0:12:29) Project Structure
⌨️ (0:20:28) Three elements of stateful .Net Maui
⌨️ (0:23:51) Page, Layout _ View, Namespaces
⌨️ (0:33:02) URL based navigation
⌨️ (0:51:10) Basics of ListView and Data Binding
⌨️ (1:05:58) Events Handling of ListView
⌨️ (1:16:54) Parameters in URL based Navigation _ Static Repository
⌨️ (1:35:35) Stacklayout for Edit Contact page
⌨️ (1:52:47) View Contact Details _ Update Contact
⌨️ (2:06:40) Observable Collection
⌨️ (2:14:58) Field Validation with .Net Maui CommunityToolkit
⌨️ (2:27:08) Reusable Control
⌨️ (2:40:37) Grid Layout and Use reusable control
⌨️ (2:53:23) ContextActions _ MenuItems in ListView
⌨️ (3:03:44) SearchBar in .NetMaui
دوره WPF پیشرفته
01 - The Basics
02 - TreeViews and Value Converters
03 - View Model MVVM Basics
04 - Custom Window Chrome and Styles
05 - Creating Login Form Sign Up Screen
06 - Attached Properties
07 - Storyboard Animations
08 - Advanced View Models Real World
09 - User Controls Side Menu Content
10 - ItemsControl Chat List & Design Time Data
11 - Dependency Injection & Multiple Projects
12 - MVVM View Model Binding to Animations
13 - Complete Page Animation
14 - Create Chat Message Bubbles
15 - Adaptive Control Design with View Model Binding
16 - Chat Message Title Bar Menu
17 - Chat Message Input Box Control
18 - Styling Scrollbars Custom
19 - Creating Popup Menus
20 - Creating Vertical Popup Menu
21 - Custom Dialog System Message Box Popup
22 - Slide Up Settings Menu
23 - Settings Page UI
24 - Advanced Edit Text Control
25 - Advanced Cross-Control Syncing
مراحل تنظیم Let's Encrypt در IIS
یک نکتهی تکمیلی
ACME V1 تا چند ماه دیگر به پایان خواهد رسید:In June of 2020 we will stop allowing new domains to validate via ACMEv1.
A simple Windows ACMEv2 client (WACS) Software version 2.1.3.671 (RELEASE, PLUGGABLE) IIS version 7.5 Running with administrator credentials Scheduled task not configured yet Please report issues at https://github.com/PKISharp/win-acme N: Create new certificate (simple for IIS) M: Create new certificate (full options) L: List scheduled renewals R: Renew scheduled S: Renew specific A: Renew *all* O: More options... Q: Quit Please choose from the menu: m Running in mode: Interactive, Advanced Please specify how the list of domain names that will be included in the certificate should be determined. If you choose for one of the "all bindings" options, the list will automatically be updated for future renewals to reflect the bindings at that time. 1: IIS 2: Manual input 3: CSR created by another program C: Abort How shall we determine the domain(s) to include in the certificate?: 1 Please select which website(s) should be scanned for host names. You may input one or more site identifiers (comma separated) to filter by those sites, or alternatively leave the input empty to scan *all* websites. 1: Default Web Site (2 bindings) Site identifier(s) or <ENTER> to choose all: 1 1: dotnettips.info (Site 1) 2: www.dotnettips.info (Site 1) You may either choose to include all listed bindings as host names in your certificate, or apply an additional filter. Different types of filters are available. 1: Pick specific bindings from the list 2: Pick bindings based on a search pattern 3: Pick bindings based on a regular expression 4: Pick *all* bindings How do you want to pick the bindings?: 4 1: dotnettips.info (Site 1) 2: www.dotnettips.info (Site 1) Please pick the most important host name from the list. This will be displayed to your users as the subject of the certificate. Common name: 2 1: dotnettips.info (Site 1) 2: www.dotnettips.info (Site 1) Continue with this selection? (y*/n) - yes Target generated using plugin IIS: www.dotnettips.info and 1 alternatives Suggested friendly name '[IIS] Default Web Site, (any host)', press <ENTER> to accept or type an alternative: <Enter> The ACME server will need to verify that you are the owner of the domain names that you are requesting the certificate for. This happens both during initial setup *and* for every future renewal. There are two main methods of doing so: answering specific http requests (http-01) or create specific dns records (dns-01). For wildcard domains the latter is the only option. Various additional plugins are available from https://github.com/PKISharp/win-acme/. 1: [http-01] Save verification files on (network) path 2: [http-01] Serve verification files from memory (recommended) 3: [http-01] Upload verification files via FTP(S) 4: [http-01] Upload verification files via SSH-FTP 5: [http-01] Upload verification files via WebDav 6: [dns-01] Create verification records manually (auto-renew not possible) 7: [dns-01] Create verification records with acme-dns (https://github.com/joohoi/acme-dns) 8: [dns-01] Create verification records with your own script 9: [tls-alpn-01] Answer TLS verification request from win-acme C: Abort How would you like prove ownership for the domain(s) in the certificate?: 2 After ownership of the domain(s) has been proven, we will create a Certificate Signing Request (CSR) to obtain the actual certificate. The CSR determines properties of the certificate like which (type of) key to use. If you are not sure what to pick here, RSA is the safe default. 1: Elliptic Curve key 2: RSA key What kind of private key should be used for the certificate?: 2 When we have the certificate, you can store in one or more ways to make it accessible to your applications. The Windows Certificate Store is the default location for IIS (unless you are managing a cluster of them). 1: IIS Central Certificate Store (.pfx per domain) 2: PEM encoded files (Apache, nginx, etc.) 3: Windows Certificate Store C: Abort How would you like to store the certificate?: 3 1: IIS Central Certificate Store (.pfx per domain) 2: PEM encoded files (Apache, nginx, etc.) 3: No additional storage steps required C: Abort Would you like to store it in another way too?: 3 With the certificate saved to the store(s) of your choice, you may choose one or more steps to update your applications, e.g. to configure the new thumbprint, or to update bindings. 1: Create or update https bindings in IIS 2: Create or update ftps bindings in IIS 3: Start external script or program 4: Do not run any (extra) installation steps Which installation step should run first?: 1 Use different site for installation? (y/n*) - no 1: Create or update ftps bindings in IIS 2: Start external script or program 3: Do not run any (extra) installation steps Add another installation step?: 3 Enter email(s) for notifications about problems and abuse (comma seperated): name@site.com Terms of service: C:\ProgramData\win-acme\acme-v02.api.letsencrypt.org\LE-SA-v1.2-November-15-2017.pdf Open in default application? (y/n*) - no Do you agree with the terms? (y*/n) - yes Authorize identifier: dotnettips.info Authorizing dotnettips.info using http-01 validation (SelfHosting) Authorization result: valid Authorize identifier: www.dotnettips.info Authorizing www.dotnettips.info using http-01 validation (SelfHosting) Authorization result: valid Requesting certificate [IIS] Default Web Site, (any host) Store with CertificateStore... Installing certificate in the certificate store Adding certificate [IIS] Default Web Site, (any host) @ 2020/2/1 9:43:55 to store My Installing with IIS... Updating existing https binding www.dotnettips.info:443 (flags: 0) Updating existing https binding dotnettips.info:443 (flags: 0) Committing 2 https binding changes to IIS Adding Task Scheduler entry with the following settings - Name win-acme renew (acme-v02.api.letsencrypt.org) - Path C:\Programs\win-acme.v2.1.3.671.x64.pluggable - Command wacs.exe --renew --baseuri "https://acme-v02.api.letsencrypt.org/" - Start at 09:00:00 - Time limit 02:00:00 Do you want to specify the user the task will run as? (y/n*) - no
اطلاعات daylight saving time یا بازه صرفه جویی زمانی ویندوز در دو مدخل رجیستری زیر ثبت میشوند:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time]
تصویر سوم مرتبط است به ویندوزهای ویستا به بعد که مفهوم dynamic daylight saving time در آنها معرفی شده است.
در اینجا یک نمونه اطلاعات زمانی ثبت شده مرتبط با ایران را مشاهده میکنید:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time] "Display"="(GMT+03:30) Tehran" "Dlt"="Iran Daylight Time" "Std"="Iran Standard Time" "MapID"="-1,72" "Index"=dword:000000a0 "TZI"=hex:2e,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,09,00,04,00,03,00,17,00,3b,\ 00,3b,00,00,00,00,00,03,00,02,00,03,00,17,00,3b,00,3b,00,00,00
using System.Runtime.InteropServices; namespace TimeZoneInfo.Core { [StructLayout(LayoutKind.Sequential)] public struct TZI { public int Bias; public int StandardBias; public int DaylightBias; public SystemTime StandardDate; public SystemTime DaylightDate; } }
using System; using System.Runtime.InteropServices; namespace TimeZoneInfo.Core { [StructLayoutAttribute(LayoutKind.Sequential)] public struct SystemTime { public short Year; public short Month; public short DayOfWeek; public short Day; public short Hour; public short Minute; public short Second; public short Milliseconds; } }
2C 01 00 00 00 00 00 00 C4 FF FF FF 00 00 0A 00 00 00 05 00 02 00 00 00 00 00 00 00 00 00 04 00 00 00 01 00 02 00 00 00 00 00 00 00
(little-endian) => (big-endian) 2C 01 00 00 => 00 00 01 2C = 300 Bias 00 00 00 00 => 00 00 00 00 = 0 Std Bias C4 FF FF FF => FF FF FF C4 = 4294967236 Dlt Bias ( SYSTEM TIME ) StandardDate 00 00 => 00 00 = Year 0A 00 => 00 0A = Month 00 00 => 00 00 = Day of Week 05 00 => 00 05 = Day 02 00 => 00 02 = Hour 00 00 => 00 00 = Minutes 00 00 => 00 00 = Seconds 00 00 => 00 00 = Milliseconds ( SYSTEM TIME ) DaylightDate 00 00 => 00 00 = Year 04 00 => 00 04 = Month 00 00 => 00 00 = Day of Week 01 00 => 00 01 = Day 02 00 => 00 02 = Hour 00 00 => 00 00 = Minutes 00 00 => 00 00 = Seconds 00 00 => 00 00 = Milliseconds
همچنین Day از یک شروع میشود و DayOfWeek از صفر. Year اگر صفر وارد شود به معنای زمان نسبی است و برای سال بعد نیز میتواند کاربرد داشته باشد (و عموما صفر تعریف شده است).
بنابراین برای تبدیل DateTime به SystemTime سازگار با TZI به فرمول زیر خواهیم رسید:
public static SystemTime ToSystemTime(DateTime time) { var result = new SystemTime { Year = 0, // سال نسبی وارد میشود نه مطلق Month = (short)time.Month, DayOfWeek = (short)time.DayOfWeek, Hour = (short)time.Hour, Minute = (short)time.Minute, Second = (short)time.Second, Milliseconds = (short)time.Millisecond }; int weekdayOfMonth = 1; // شماره هفته است نه شماره روز for (int dd = time.Day; dd > 7; dd -= 7) weekdayOfMonth++; result.Day = (short)weekdayOfMonth; return result; }
using System; using System.Runtime.InteropServices; namespace TimeZoneInfo.Core { public static class ByteUtils { public static Byte[] SerializeByteArray<T>(T msg) where T : struct { int objsize = Marshal.SizeOf(typeof(T)); Byte[] ret = new Byte[objsize]; IntPtr buff = Marshal.AllocHGlobal(objsize); Marshal.StructureToPtr(msg, buff, true); Marshal.Copy(buff, ret, 0, objsize); Marshal.FreeHGlobal(buff); return ret; } } }
پس از اعمال تغییرات فوق، نیاز است یکبار ویندوز را ری استارت کنید.
دوره 8 ساعته Microservices در دات نت
Introduction to .NET Microservices (.NET 8)
In this Introduction course, we will learn Microservices with .NET 8 (MVC).
Microservices is an upcoming technology, where it is very easy to scale and break down large project in simple and manageable services.
In this course we will build multiple services and see how they function together by communicating in synchronous and asynchronous manner.
⭐️ Course Contents ⭐️
⌨️ (0:00:01) Section 1 - Welcome & Getting Started
⌨️ (0:28:15) Section 2 - Coupon API - Fundamentals
⌨️ (1:15:54) Section 3 - Coupon API - CRUD
⌨️ (2:21:24) Section 4 - Auth API
⌨️ (3:20:08) Section 5 - Consuming Auth API
⌨️ (4:26:53) Section 6 - Product API
⌨️ (4:57:59) Section 7 - Home and Details Page
⌨️ (5:09:35) Section 8 - Shopping Cart
⌨️ (6:08:04) Section 9 - Shopping Cart in Web Project
⌨️ (6:58:06) Section 10 - Service Bus
⌨️ (7:23:42) Section 11 - Email API - Service Bus
⌨️ (7:54:11) What's Next?
WebAssembly, or Wasm, is on its way to becoming the next big thing in software development, allowing us to develop more reusable code across programming stacks. It will also enable the deployment of smaller packages more securely. This talk will focus on the view of a .NET developer using WebAssembly in their projects, whether client-side, server-side, or plugins.
Agenda
0:00:00 – Introduction
0:01:44 – Presentation Start
0:04:36 – Wasm on the client
0:08:27 – Wasm on the server
0:11:51 – ASP.NET Core in Wasi
0:21:41 – Wasm in the cloud
0:32:38 – Wasm for plugins
0:36:07 – Wasm plugins samples
0:49:05 – .NET 8 and the future
0:55:08 – Who’s working on this?
1:03:13 – Outro
BEGINNERS Budget App .NET 6, ASP.NET C# MVC (FULL PROJECT) - YouTube
Chapters
0:00 - Intro
2:45 - Create Project
3:32 - Examine Files
5:56 - Cleaning Up
8:00 - Create Database
10:24 - Repository
14:50 - View Models
17:35 - List of Transactions
21:25 - Add Transactions
33:40 - Update Transactions
36:45 - Delete Transactions
39:20 - Categories List
43:00 - Insert Categories
46:00 - Update Categories
47:30 - Delete Categories
49:15 - Frontend Validation
49:50 - Transactions Filter
55:00 - Styling
مقدمهای بر NET MAUI.
An Introduction to .NET MAUI For Mobile Development
.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML.
.NET MAUI is open-source and is the evolution of Xamarin.Forms, extended from mobile to desktop scenarios, with UI controls rebuilt from the ground up for performance and extensibility. If you've previously used Xamarin.Forms to build cross-platform user interfaces, you'll notice many similarities with .NET MAUI. However, there are also some differences. Using .NET MAUI, you can create multi-platform apps using a single project, but you can add platform-specific source code and resources if necessary. One of the key aims of .NET MAUI is to enable you to implement as much of your app logic and UI layout as possible in a single code-base.
0:00 - Setup Visual Studio and MAUI Project
00:16:25 - Create MAUI Pages with C#
00:27:42 - Create MAUI Pages with XAML
00:32:28 - Explore MAUI Layouts
00:39:38 - Static Shared Resources
00:44:36 - Platform Specific Values
00:50:11 - Page Navigation
میانگین متحرک یا moving average به چند دسته تقسیم میشود که سادهترین آنها میان متحرک ساده است.
برای محاسبه میانگین متحرک باید بازه زمانی مورد نظر را مشخص کنیم. مثلا میانگین فروش در 3 روز گذشته.
به جدول زیر توجه بفرمایید:
میانگین متحرک فروش سه روز و چهار روز گذشته در جدول فوق قابل مشاهده است.
بطور مثال مقدار میانگین متحرک سه روزه برای روز چهارم برابر است با جمع فروش سه روز گذشته تقسیم بر سه. یعنی 3/(10+12+13)
و برای روز ششم میانگین متحرک 4 روزه برابر است با جمع فروش چهار روز گذشته و تقسیم آنها بر چهار. یعنی 10+12+13+16 تقسیم بر 4 که برابر است با 12.7
در نمودار زیر، خط قرم رنگ مربوط به میانگین متحرک ساده (میانگین فروش سه روز گذشته) است و خط آبی رنگ نیز میزان فروش است
راه حل در SQL Server 2012
توسط توابع window این مساله را به سادگی میتوانیم حل کنیم. همانطور که مشاهده میشود در تصویر زیر. کافیست ما به سطرهایی در بازهی سه سطر قبل تا یک سطر قبل (برای میانگین متحرک سه روزه) دسترسی پیدا کرده و میانگین آن را بگیریم.
ابتدا این جدول را ایجاد و تعدادی سطر برای نمونه در آن درج کنید:
CREATE TABLE Samples ( [date] SMALLDATETIME, selling SMALLMONEY ); INSERT Samples VALUES ('2010-12-01 00:00:00', 10), ('2010-12-02 00:00:00', 12), ('2010-12-03 00:00:00', 13), ('2010-12-04 00:00:00', 16), ('2010-12-05 00:00:00', 19), ('2010-12-06 00:00:00', 23), ('2010-12-07 00:00:00', 26), ('2010-12-08 00:00:00', 27), ('2010-12-09 00:00:00', 20), ('2010-12-10 00:00:00', 18), ('2010-12-11 00:00:00', 19);
SELECT [date], selling, CASE WHEN rnk < 4 THEN NULL ELSE mv END AS SimpleMovingAverage FROM (SELECT *, AVG(selling) OVER(ORDER BY [date] ROWS BETWEEN 3 PRECEDING AND 1 PRECEDING) AS mv, ROW_NUMBER() OVER(ORDER BY [date]) AS rnk FROM Samples ) AS d;
قلب query دستور ROWS BETWEEN 3 PRECEDING AND 1 PRECEDING میباشد.
به این معنا که سطرهایی در بازهی سه سطر قبل و یک سطر قبل را در Window انتخاب کرده و عمل میاگنین گیری را بر اساس مقادیر مورد نظر انجام بده.
راه حل در SQL Server 2005
به درخواست یکی از کاربران من راه حلی را پیشنهاد میکنم که جایگزین مناسبی برای روش قبلی است در صورت عدم استفاده از نسخه 2012. توابع window در اینگونه مسائل بهترین عملکرد را خواهند داشت.
SELECT S.[date], S.selling, CASE WHEN COUNT(*) < 3 THEN NULL ELSE AVG(s) END AS SimpleMovingAverage FROM Samples AS S OUTER APPLY (SELECT TOP(3) selling FROM Samples WHERE [date] < S.[date] ORDER BY [date] DESC) AS D(s) GROUP BY S.[date], S.selling ORDER BY S.[date];
FOR FUN
توسط توابع Analytical ای چون LAG نیز میتوان اینگونه مسائل را حل نمود. بطور مثال توسط تابع LAG به یک مقدار قبلی، دو مقدار قبلی و سه مقدار قبلی دسترسی پیدا کرده و آنها را با یکدیگر جمع نموده و تقسیم بر تعدادشان میکنیم یعنی:
select [date], selling, ( lag(selling, 1) over(order by [date]) + lag(selling, 2) over(order by [date]) + lag(selling, 3) over(order by [date]) ) / 3 from Samples;
قسمت چهارم از سری بررسی معماری نرم افزار Architecture Characteristics and Design Principles - Part
در قسمت 4 ام به یه جمع بندی در مورد تعریف معماری رسیدیم و چهار بعد اصلی یه معماری رو بررسی کردیم و از جلسه بعدی میریم توی بحث الگوهای معماری مثل کلین و اون هارو کامل بررسی میکنیم.
01:00 Previous Session
02:35 Frozen Caveman anti-pattern
08:00 Architecture Characteristics
09:00 NFR
11:35 Architecture Decisions
15:14 Design Principles
#design #architecture