MetroFramework Modern UI Sliding Panel
MetroFramework Modern UI Sliding Panel
MetroFramework Modern UI Sliding Panel is a sample project that will demonstrate on how to make a sliding panel for MetroFramework Modern UI. The sliding panel can be used as an alternative for MDI view for MetroFramework Modern UI. I will try my best to explain everything that I did on this project hopefully you can get something from it and hopefully I can help you with your projects.
Needed Frameworks :
1. MetroFramework Modern UI – new Modern UI alias Metro UI of Windows 8 to .NET Windows Forms applications
2. dot-net-transitions – A library for animated UI transitions for .NET
In this project I will not show you on how to use metroframework modern ui, you can check out my other blog post. You should atleast familiar or have basic understanding on how to use metroframework modern ui.
OK so lets start to check the code and I will try to explain it one by one.
First thing that we need to create is a panel slider template that will contain the sliding effect and other functions like adding the panel on your form and etc. On my MetroFramework Modern UI Sliding Panel I named my template panel slider as `pnlSlider`
The following codes are just the declaration of variables and event for the panel slider template. By default I only added two event which is the `Closed` and `Shown`, you can add more if you needed. This can be used to disable and enable the button the will trigger the display of the sliding panel.
//variables Form _owner = null; bool _loaded = false; //events #region Events public event EventHandler Closed; public event EventHandler Shown; protected virtual void closed(EventArgs e) { EventHandler handler = Closed; if (handler != null) handler(this, e); } protected virtual void shown(EventArgs e) { EventHandler handler = Shown; if (handler != null) handler(this, e); } #endregion