|
| 1 | +# Form Factor Selector |
| 2 | + |
1 | 3 | Form factor selection in editor |
2 | 4 |
|
3 | 5 | Allow you to change the form factor in edit mode, helping you to design responsive applications |
4 | 6 |
|
5 | | -<img width="216" alt="msedge_rcavLxE04h" src="./assets/formfactorselector.png" /> |
| 7 | + |
| 8 | + |
| 9 | +## Authors |
| 10 | + |
| 11 | +Snippet|Author |
| 12 | +--------|--------- |
| 13 | +David Zoonekyndt | [GitHub](https://github.com/DavidZoon) ([LinkedIn](https://www.linkedin.com/in/david-zoonekyndt/) ) |
6 | 14 |
|
7 | | -⚠️⚠️⚠️ Important: |
| 15 | +## Minimal path to awesome |
8 | 16 |
|
9 | | - Set Gallery.Y to : -Self.Height |
| 17 | +1. Open your canvas app in **Power Apps** |
| 18 | +2. Copy the contents of the **[YAML-file](./source/formfactor.yaml)** |
| 19 | +3. Click on the three dots of the screen where you want to add the snippet and select "Paste" |
10 | 20 |
|
| 21 | +### ⚠️⚠️⚠️ Important: |
| 22 | + |
| 23 | +Set `Gallery.Y` to `-Self.Height` |
| 24 | + |
| 25 | +You need to replace for<b> every screen</b> the following properties, otherwise screen will not be affected by your formfactor selection: |
11 | 26 |
|
12 | | - You need to replace for<b> every screen</b> properties, otherwise screen will not be affected by your formfactor selection : |
| 27 | +**Width** |
13 | 28 |
|
14 | | - Width : |
15 | | - Max(App.Width, App.MinScreenWidth) |
| 29 | +Replace: |
| 30 | +```Max(App.Width, App.MinScreenWidth)``` |
| 31 | + |
| 32 | +by: |
| 33 | +```Coalesce(vFormFactor.Width,Max(App.Width, App.MinScreenWidth))``` |
| 34 | + |
| 35 | +**Height** |
| 36 | + |
| 37 | +Replace: |
| 38 | +```Max(App.Height, App.MinScreenHeight)``` |
| 39 | + |
| 40 | +by: |
| 41 | +```Coalesce(vFormFactor.Height,Max(App.Height, App.MinScreenHeight))``` |
| 42 | + |
| 43 | +<img width="520" alt="sample_tablet_landscape" src="./assets/sample_tablet_landscape.png" /> |
| 44 | +<img width="206" alt="sample_tablet_portrait.png" src="./assets/sample_tablet_portrait.png" /> |
| 45 | +<img width="150" alt="phone_portrait.png" src="./assets/sample_phone_portrait.png" /> |
| 46 | + |
| 47 | +## Code |
| 48 | + **[YAML-file](./source/formfactor.yaml)** |
16 | 49 |
|
17 | | - by : |
18 | | - Coalesce(vFormFactor.Width,Max(App.Width, App.MinScreenWidth)) |
19 | | - Height : |
20 | | - Max(App.Height, App.MinScreenHeight) |
| 50 | + ## Disclaimer |
21 | 51 |
|
22 | | - by : |
23 | | - Coalesce(vFormFactor.Height,Max(App.Height, App.MinScreenHeight)) |
| 52 | +**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** |
24 | 53 |
|
25 | | -<img width="520" alt="sample_tablet_landscape" src="./assets/sample_tablet_landscape.png" /><img width="206" alt="sample_tablet_portrait.png" src="./assets/sample_tablet_portrait.png" /><img width="150" alt="phone_portrait.png" src="./assets/sample_phone_portrait.png" /> |
| 54 | +<img src="https://m365-visitor-stats.azurewebsites.net/powerplatform-snippets/power-apps/form-factor-selector" aria-hidden="true" /> |
0 commit comments