I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
In this article, I will show you, How to create Shadow of controls. Through this, we can show 3d view of control. First of all, I will apply this style on manually created designs like Ellipse, Rectangle etc. After that I will apply same things on controls. So, add a new window in the project. Add this code in between the <grid> ...</grid> section of xaml file.
<Rectangle Height="150" Width="150" Stroke="Black" StrokeThickness="2">
<Rectangle.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="-50" ShadowDepth="40" Softness=".8"/>
</Rectangle.BitmapEffect>
<Rectangle.Fill>
<ImageBrush ImageSource="apple.png"/>
</Rectangle.Fill>
</Rectangle>
BitmapEffect creates the shadow effect behind the object. In the above-mentioned code we have Direction attribute. With the help of Direction attribute we can show shadow of control at user defined position.
<Button Width="150" Margin="71,167,71,59">
<Button.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="-50" ShadowDepth="40" Softness=".7"/>
</Button.BitmapEffect>
<Image Source="apple.png" Stretch="Fill"/>
Code generates the following output
Comments
Post a Comment