AppPinManager in UWP Toolkit
6K views
Nov 7, 2023
Explain about how to use the AppPinManager class.
View Video Transcript
0:00
hello welcome to all initial Windows programming tutorial at this tutorial I'm going to explain
0:08
about how to use the upbeat manager class this class in available in the UWT community toolkit
0:15
and one more I make I am the creator of this class what is the use of this class this class
0:24
used to add the app in the start start menu or in the taskbar so if you if you
0:34
follow that normal we develop people you have to follow so many steps that I
0:40
already explained in the task manager class that I released one tutorial you
0:48
can go to go to the C sharp corner you can see this tutorial so so many steps
0:53
is available now this API will take care of all the things all the steps you just call that
1:01
functions only that's it now here you can see this API is this class contain the four
1:08
APIs two for a taskbar pin the app in the taskbar and two for the start menu so first one you see
1:17
the taskbar I think it's a default it will pin the app so second one is a it's
1:23
connecting the argument app list entry this taking which app you want to pin to
1:29
the taskbar suppose your package container two or three app list so which
1:35
one you want to pin into the taskbar so that information you can pass it the
1:42
next one is a start menu API this API used to pin the app in the start menu so
1:51
here also you need to pass the app list which app you want to pin it the second
1:58
known is start menu API is a you need to pass the user so user based you can pin
2:03
it so suppose if the system two or three user which user you want to pin the
2:09
up in this app in the start menu that also you can specify so four type is available
2:15
and the four function return the pin result is a enum so these are the result written by this api
2:25
so suppose if uh we are running the unsupported device so that os version is not supported
2:31
some group policies pin not allowed so pin only pin successfully been placed in the taskbar so it
2:39
return the pin present so it's already up available so it will turn the pin already present
2:47
suppose user cancel that pin request so it will return the pin operation failed these are the
2:53
the enum results So now I going to explain about how to implement this class in Visual Studio 2017 I created a already one project has created I going to use the same only
3:12
And make sure start menu is supporting Windows 10 creator updater and the taskbar pin support
3:20
fall creator update okay now go to the right click new get manage naked package go to online here
3:34
you can search good ability toolkit so here you need to select this toolkit dot uwp so this is a
3:45
helper method click it latest stable build 2.1 you have to download it so to 2.081 support it's
3:54
available in the 2.1 onwards so select that only install now the package get install in my pc
4:15
okay let it in self so here you can see that supporting version start menu is
4:32
the version 15063 and the taskbar supporting version 16229 okay now back
4:41
to Visual Studio yeah it's on it except now it's installing okay let it in sir
4:57
then going back to XAML page just check it yeah everything is all perfect so here
5:10
what I do so I'm adding two button one for into taskbar click the font says
6:25
just a make one and two only maintaining any naming conversion here just make one
6:34
and two no I rename that one one two yeah that's it so and one more to display the result
6:47
add one more stack panel, text block, text name, txt status and font size 35, the foreground
7:14
color something like red okay now back to page here what I'm going to do I just
7:23
calling that API so far in result equal to app in manager
7:34
added up in manager again here you can see it come on
7:52
okay let it come so so here you can see that all are async method only so we have to add the
7:59
sync concept a sync wait so have been manager this was up in the current app in
8:11
the taskbar so once the result is coming text the status dot text equal to win
8:17
result dot to sting Okay, this function for button to for the start menu
8:28
So what I'm going to do here also when in result await app in manager dot pin specific app to the start menu
8:48
So this one needs the app list entry. So we had to get it the app list entry
8:52
So make applist applist equal to package So getting the package current get applist entry so this is
9:07
the async method we have to use a weight concept so this here should support
9:13
async weight so in this one I am what I am going to do it is only one package
9:18
only so anyway so I am just taking the first package index so I am passing you
9:25
have to paste this app list that's it so then I need to print the results so see
9:34
it takes equal to print result dot to string so I just rebuild the application if you go to
9:48
solution explore here you can see that toolkit is added so if I open this one view object in
9:54
browser toolkit toolkit helper app in manager so here you can see that all the
10:10
methods and result also you can see it in result so here you can see all the
10:19
So here you can see the summary is if suppose if unsupported, this means the here you can see the pin supported SDK version also we mentioned and taskbar version also we mentioned which version support. Yeah, so build success. Now start the application
10:43
Deploy has started, deploy succeeded. oh there is no marching okay fine so if I click the pin start menu then
11:00
automatically this API promote the confirmation from the user do you want
11:07
pin the app in the start menu suppose if they what they don't want then if you
11:11
click the no then it will come pin operation failed maybe user has cancelled
11:17
suppose if I click pin to start menu sorry start by taskbar if taskbar also
11:25
automatically that confirmation message it will come to get the confirmation to
11:30
the user so suppose if you know if they accepted yes then pin present if you go
11:36
to if you go to taskbar you can see that result pin present in the taskbar
11:47
back to I hope you can understand how to use a pin app manager class in using
11:54
our social studio sorry UW community toolkit thanks to all
#Programming
#Software