Hello,
Welcome to Microsoft Q&A!
How to get app width
You can get the current width of window by using Window::Current().Bounds().Width
method.
How can I listen to a change event for when the window is resized and update the slider?
There is a CoreWindow.SizeChanged Event can be used to listen for window size changes. You can directly change the Maximum in code-behind or create a ViewModel to bind to the Maximum of Slider and change the property of ViewModel to change the Maximum.
#include "winrt/Windows.UI.Core.h"
MainPage::MainPage()
{
InitializeComponent();
Window::Current().CoreWindow().SizeChanged([this](Windows::UI::Core::CoreWindow const&, Windows::UI::Core::WindowSizeChangedEventArgs const&) {
Slider1().Maximum(Windows::UI::Xaml::Window::Current().Bounds().Width);
});
}