├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md └── src ├── .vsconfig ├── BandCenter.Maui ├── App.xaml ├── App.xaml.cs ├── BandCenter.Maui.csproj ├── Controls │ ├── ActivityTile.xaml │ ├── ActivityTile.xaml.cs │ ├── MetricMarkupPresenter.xaml │ └── MetricMarkupPresenter.xaml.cs ├── MainPage.xaml ├── MainPage.xaml.cs ├── MauiProgram.cs ├── Platforms │ ├── Android │ │ ├── AndroidManifest.xml │ │ ├── MainActivity.cs │ │ ├── MainApplication.cs │ │ └── Resources │ │ │ └── values │ │ │ └── colors.xml │ ├── MacCatalyst │ │ ├── AppDelegate.cs │ │ ├── Info.plist │ │ └── Program.cs │ ├── Windows │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── Package.appxmanifest │ │ └── app.manifest │ └── iOS │ │ ├── AppDelegate.cs │ │ ├── Info.plist │ │ ├── Program.cs │ │ └── Resources │ │ └── LaunchScreen.xib ├── Properties │ └── launchSettings.json └── Resources │ ├── Fonts │ ├── OpenSans-Regular.ttf │ └── ProjectKSymbolRegular.ttf │ ├── Images │ └── dotnet_bot.svg │ ├── appicon.svg │ └── appiconfg.svg ├── BandCenter.Uno ├── BandCenter.Uno.Droid │ ├── Assets │ │ ├── AboutAssets.txt │ │ └── Fonts │ │ │ ├── ProjectKSymbolRegular.ttf │ │ │ └── uno-fluentui-assets.ttf │ ├── BandCenter.Uno.Droid.csproj │ ├── Main.cs │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ └── Resources │ │ ├── AboutResources.txt │ │ ├── mipmap-hdpi │ │ └── icon.png │ │ ├── mipmap-ldpi │ │ └── icon.png │ │ ├── mipmap-mdpi │ │ └── icon.png │ │ ├── mipmap-tvdpi │ │ └── icon.png │ │ ├── mipmap-xhdpi │ │ └── icon.png │ │ ├── mipmap-xxhdpi │ │ └── icon.png │ │ ├── mipmap-xxxhdpi │ │ └── icon.png │ │ └── values │ │ ├── Strings.xml │ │ └── Styles.xml ├── BandCenter.Uno.Shared │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ └── SharedAssets.md │ ├── BandCenter.Uno.Shared.projitems │ ├── BandCenter.Uno.Shared.shproj │ ├── Controls │ │ ├── ActivityTile.cs │ │ ├── MetricMarkupPresenter.xaml │ │ └── MetricMarkupPresenter.xaml.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Strings │ │ └── en │ │ │ └── Resources.resw │ └── Themes │ │ ├── ActivityTileStyles.xaml │ │ └── ActivityTileStyles.xaml.cs ├── BandCenter.Uno.Skia.Gtk │ ├── Assets │ │ └── Fonts │ │ │ └── uno-fluentui-assets.ttf │ ├── BandCenter.Uno.Skia.Gtk.csproj │ ├── Program.cs │ └── app.manifest ├── BandCenter.Uno.Skia.Tizen │ ├── Assets │ │ └── Fonts │ │ │ └── uno-fluentui-assets.ttf │ ├── BandCenter.Uno.Skia.Tizen.csproj │ ├── Program.cs │ ├── shared │ │ └── res │ │ │ └── Icon.png │ └── tizen-manifest.xml ├── BandCenter.Uno.Skia.Wpf.Host │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ └── Fonts │ │ │ └── uno-fluentui-assets.ttf │ ├── BandCenter.Uno.Skia.Wpf.Host.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ └── app.manifest ├── BandCenter.Uno.Skia.Wpf │ ├── BandCenter.Uno.Skia.Wpf.csproj │ └── Program.cs ├── BandCenter.Uno.UWP │ ├── Assets │ │ ├── Fonts │ │ │ └── ProjectKSymbolRegular.ttf │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ ├── BandCenter.Uno.UWP.csproj │ ├── Package.appxmanifest │ └── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml ├── BandCenter.Uno.Wasm │ ├── Assets │ │ └── SplashScreen.png │ ├── BandCenter.Uno.Wasm.csproj │ ├── LinkerConfig.xml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WasmCSS │ │ └── Fonts.css │ ├── WasmScripts │ │ └── AppManifest.js │ └── wwwroot │ │ └── web.config ├── BandCenter.Uno.iOS │ ├── BandCenter.Uno.iOS.csproj │ ├── Entitlements.plist │ ├── Info.plist │ ├── LaunchScreen.storyboard │ ├── Main.cs │ ├── Media.xcassets │ │ ├── AppIcons.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon1024.png │ │ │ ├── Icon120.png │ │ │ ├── Icon152.png │ │ │ ├── Icon167.png │ │ │ ├── Icon180.png │ │ │ ├── Icon20.png │ │ │ ├── Icon29.png │ │ │ ├── Icon40.png │ │ │ ├── Icon58.png │ │ │ ├── Icon60.png │ │ │ ├── Icon76.png │ │ │ ├── Icon80.png │ │ │ └── Icon87.png │ │ └── LaunchImages.launchimage │ │ │ └── Contents.json │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Resources │ │ ├── Default-568h@2x.png │ │ ├── Fonts │ │ └── uno-fluentui-assets.ttf │ │ ├── SplashScreen@2x.png │ │ └── SplashScreen@3x.png └── BandCenter.Uno.macOS │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── AppIcon-128.png │ │ ├── AppIcon-128@2x.png │ │ ├── AppIcon-16.png │ │ ├── AppIcon-16@2x.png │ │ ├── AppIcon-256.png │ │ ├── AppIcon-256@2x.png │ │ ├── AppIcon-32.png │ │ ├── AppIcon-32@2x.png │ │ ├── AppIcon-512.png │ │ ├── AppIcon-512@2x.png │ │ └── Contents.json │ ├── Contents.json │ └── unologo.imageset │ │ ├── Contents.json │ │ └── unoplatform.jpg │ ├── BandCenter.Uno.macOS.csproj │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── Resources │ └── Fonts │ └── uno-fluentui-assets.ttf ├── BandCenter.sln └── NuGet.config /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Nuget personal access tokens and Credentials 210 | # nuget.config 211 | 212 | # Microsoft Azure Build Output 213 | csx/ 214 | *.build.csdef 215 | 216 | # Microsoft Azure Emulator 217 | ecf/ 218 | rcf/ 219 | 220 | # Windows Store app package directories and files 221 | AppPackages/ 222 | BundleArtifacts/ 223 | Package.StoreAssociation.xml 224 | _pkginfo.txt 225 | *.appx 226 | *.appxbundle 227 | *.appxupload 228 | 229 | # Visual Studio cache files 230 | # files ending in .cache can be ignored 231 | *.[Cc]ache 232 | # but keep track of directories ending in .cache 233 | !?*.[Cc]ache/ 234 | 235 | # Others 236 | ClientBin/ 237 | ~$* 238 | *~ 239 | *.dbmdl 240 | *.dbproj.schemaview 241 | *.jfm 242 | *.pfx 243 | *.publishsettings 244 | orleans.codegen.cs 245 | 246 | # Including strong name files can present a security risk 247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 248 | #*.snk 249 | 250 | # Since there are multiple workflows, uncomment next line to ignore bower_components 251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 252 | #bower_components/ 253 | 254 | # RIA/Silverlight projects 255 | Generated_Code/ 256 | 257 | # Backup & report files from converting an old project file 258 | # to a newer Visual Studio version. Backup files are not needed, 259 | # because we have git ;-) 260 | _UpgradeReport_Files/ 261 | Backup*/ 262 | UpgradeLog*.XML 263 | UpgradeLog*.htm 264 | ServiceFabricBackup/ 265 | *.rptproj.bak 266 | 267 | # SQL Server files 268 | *.mdf 269 | *.ldf 270 | *.ndf 271 | 272 | # Business Intelligence projects 273 | *.rdl.data 274 | *.bim.layout 275 | *.bim_*.settings 276 | *.rptproj.rsuser 277 | *- [Bb]ackup.rdl 278 | *- [Bb]ackup ([0-9]).rdl 279 | *- [Bb]ackup ([0-9][0-9]).rdl 280 | 281 | # Microsoft Fakes 282 | FakesAssemblies/ 283 | 284 | # GhostDoc plugin setting file 285 | *.GhostDoc.xml 286 | 287 | # Node.js Tools for Visual Studio 288 | .ntvs_analysis.dat 289 | node_modules/ 290 | 291 | # Visual Studio 6 build log 292 | *.plg 293 | 294 | # Visual Studio 6 workspace options file 295 | *.opt 296 | 297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 298 | *.vbw 299 | 300 | # Visual Studio LightSwitch build output 301 | **/*.HTMLClient/GeneratedArtifacts 302 | **/*.DesktopClient/GeneratedArtifacts 303 | **/*.DesktopClient/ModelManifest.xml 304 | **/*.Server/GeneratedArtifacts 305 | **/*.Server/ModelManifest.xml 306 | _Pvt_Extensions 307 | 308 | # Paket dependency manager 309 | .paket/paket.exe 310 | paket-files/ 311 | 312 | # FAKE - F# Make 313 | .fake/ 314 | 315 | # CodeRush personal settings 316 | .cr/personal 317 | 318 | # Python Tools for Visual Studio (PTVS) 319 | __pycache__/ 320 | *.pyc 321 | 322 | # Cake - Uncomment if you are using it 323 | # tools/** 324 | # !tools/packages.config 325 | 326 | # Tabs Studio 327 | *.tss 328 | 329 | # Telerik's JustMock configuration file 330 | *.jmconfig 331 | 332 | # BizTalk build output 333 | *.btp.cs 334 | *.btm.cs 335 | *.odx.cs 336 | *.xsd.cs 337 | 338 | # OpenCover UI analysis results 339 | OpenCover/ 340 | 341 | # Azure Stream Analytics local run output 342 | ASALocalRun/ 343 | 344 | # MSBuild Binary and Structured Log 345 | *.binlog 346 | 347 | # NVidia Nsight GPU debugger configuration file 348 | *.nvuser 349 | 350 | # MFractors (Xamarin productivity tool) working folder 351 | .mfractor/ 352 | 353 | # Local History for Visual Studio 354 | .localhistory/ 355 | 356 | # BeatPulse healthcheck temp database 357 | healthchecksdb 358 | 359 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 360 | MigrationBackup/ 361 | 362 | # Ionide (cross platform F# VS Code tools) working folder 363 | .ionide/ 364 | 365 | # Fody - auto-generated XML schema 366 | FodyWeavers.xsd 367 | 368 | # VS Code files for those working on multiple tools 369 | .vscode/* 370 | !.vscode/settings.json 371 | !.vscode/tasks.json 372 | !.vscode/launch.json 373 | !.vscode/extensions.json 374 | *.code-workspace 375 | 376 | # Local History for Visual Studio Code 377 | .history/ 378 | 379 | # Windows Installer files from build outputs 380 | *.cab 381 | *.msi 382 | *.msix 383 | *.msm 384 | *.msp 385 | 386 | # JetBrains Rider 387 | .idea/ 388 | *.sln.iml 389 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libs/band-sdk"] 2 | path = libs/band-sdk 3 | url = https://github.com/MicrosoftBandDev/band-sdk.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Band Center (companion-app) 2 | A replacement of the Microsoft Health app for Microsoft Band 1/2 3 | 4 | ## Building the project 5 | Band Center uses .NET MAUI, which is still in the preview stages. Please follow the [installation guide in the .NET MAUI documentation](https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation), 6 | and remember that you need Visual Studio 2022 *Preview*. 7 | 8 | Once you have the development environment set up, you're ready to clone the repo. 9 | ```bash 10 | git clone https://github.com/MicrosoftBandDev/companion-app.git 11 | cd ./companion-app 12 | ``` 13 | 14 | In the future, you may also need to run the following: 15 | ```bash 16 | git submodule init 17 | git submodule update 18 | ``` 19 | 20 | Once the repo has been downloaded, you can get started by opening [the BandCenter solution](https://github.com/MicrosoftBandDev/companion-app/blob/main/BandCenter/BandCenter.sln) 21 | in VS 2022 Preview. 22 | -------------------------------------------------------------------------------- /src/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Component.CoreEditor", 5 | "Microsoft.VisualStudio.Workload.CoreEditor", 6 | "Microsoft.NetCore.Component.Runtime.3.1", 7 | "Microsoft.NetCore.Component.SDK", 8 | "Microsoft.VisualStudio.Component.NuGet", 9 | "Microsoft.VisualStudio.Component.Roslyn.Compiler", 10 | "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", 11 | "Microsoft.NetCore.Component.DevelopmentTools", 12 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", 13 | "Microsoft.VisualStudio.Component.DockerTools", 14 | "Microsoft.NetCore.Component.Web", 15 | "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", 16 | "Microsoft.VisualStudio.Component.TypeScript.4.0", 17 | "Microsoft.VisualStudio.Component.JavaScript.TypeScript", 18 | "Microsoft.VisualStudio.Component.JavaScript.Diagnostics", 19 | "Microsoft.Component.MSBuild", 20 | "Microsoft.VisualStudio.Component.TextTemplating", 21 | "Component.Microsoft.VisualStudio.RazorExtension", 22 | "Microsoft.VisualStudio.Component.IISExpress", 23 | "Microsoft.VisualStudio.Component.SQL.ADAL", 24 | "Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime", 25 | "Microsoft.VisualStudio.Component.Common.Azure.Tools", 26 | "Microsoft.VisualStudio.Component.SQL.CLR", 27 | "Microsoft.VisualStudio.Component.MSODBC.SQL", 28 | "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils", 29 | "Microsoft.VisualStudio.Component.ManagedDesktop.Core", 30 | "Microsoft.VisualStudio.Component.SQL.SSDT", 31 | "Microsoft.VisualStudio.Component.SQL.DataSources", 32 | "Component.Microsoft.Web.LibraryManager", 33 | "Microsoft.VisualStudio.ComponentGroup.Web", 34 | "Microsoft.VisualStudio.Component.Web", 35 | "Microsoft.VisualStudio.Component.IntelliCode", 36 | "Component.Microsoft.VisualStudio.LiveShare", 37 | "Microsoft.VisualStudio.ComponentGroup.Web.Client", 38 | "Microsoft.Net.ComponentGroup.TargetingPacks.Common", 39 | "Component.Microsoft.VisualStudio.Web.AzureFunctions", 40 | "Microsoft.VisualStudio.ComponentGroup.AzureFunctions", 41 | "Microsoft.VisualStudio.Component.Azure.Compute.Emulator", 42 | "Microsoft.VisualStudio.Component.Azure.Storage.Emulator", 43 | "Microsoft.VisualStudio.Component.Azure.ClientLibs", 44 | "Microsoft.VisualStudio.Component.Azure.AuthoringTools", 45 | "Microsoft.VisualStudio.Component.CloudExplorer", 46 | "Microsoft.VisualStudio.ComponentGroup.Web.CloudTools", 47 | "Microsoft.VisualStudio.Component.DiagnosticTools", 48 | "Microsoft.VisualStudio.Component.EntityFramework", 49 | "Microsoft.VisualStudio.Component.AspNet45", 50 | "Microsoft.VisualStudio.Component.AppInsights.Tools", 51 | "Microsoft.VisualStudio.Component.WebDeploy", 52 | "Microsoft.VisualStudio.Component.Wcf.Tooling", 53 | "Microsoft.VisualStudio.Workload.NetWeb", 54 | "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", 55 | "Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools", 56 | "Microsoft.VisualStudio.Component.Azure.Waverton", 57 | "Microsoft.Component.Azure.DataLake.Tools", 58 | "Microsoft.VisualStudio.Component.Azure.Kubernetes.Tools", 59 | "Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools", 60 | "Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools", 61 | "Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices", 62 | "Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools", 63 | "Microsoft.VisualStudio.Workload.Azure", 64 | "Microsoft.VisualStudio.Component.VC.CoreIde", 65 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", 66 | "Microsoft.VisualStudio.Component.Graphics.Tools", 67 | "Microsoft.VisualStudio.Component.Windows10SDK.19041", 68 | "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", 69 | "Microsoft.ComponentGroup.Blend", 70 | "Microsoft.VisualStudio.Component.Debugger.JustInTime", 71 | "Microsoft.VisualStudio.Component.PortableLibrary", 72 | "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", 73 | "Microsoft.VisualStudio.Workload.ManagedDesktop", 74 | "Microsoft.VisualStudio.Component.Windows10SDK.18362", 75 | "Microsoft.VisualStudio.Component.Windows10SDK.17763", 76 | "Microsoft.Component.NetFX.Native", 77 | "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard", 78 | "Microsoft.VisualStudio.Component.Graphics", 79 | "Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin", 80 | "Microsoft.VisualStudio.ComponentGroup.UWP.Support", 81 | "Microsoft.VisualStudio.Component.VC.Tools.ARM64", 82 | "Microsoft.VisualStudio.Component.UWP.VC.ARM64", 83 | "Microsoft.VisualStudio.Component.VC.Tools.ARM", 84 | "Microsoft.VisualStudio.ComponentGroup.UWP.VC", 85 | "Microsoft.VisualStudio.Workload.Universal", 86 | "Component.OpenJDK", 87 | "Microsoft.VisualStudio.Component.MonoDebugger", 88 | "Microsoft.VisualStudio.Component.Merq", 89 | "Component.Xamarin.RemotedSimulator", 90 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", 91 | "Component.Xamarin", 92 | "Component.Android.SDK28", 93 | "Microsoft.VisualStudio.Workload.NetCrossPlat", 94 | "Microsoft.VisualStudio.Workload.NetCoreTools", 95 | "Microsoft.VisualStudio.ComponentGroup.Maui.All", 96 | ] 97 | } 98 | -------------------------------------------------------------------------------- /src/BandCenter.Maui/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | #005AA1 11 | White 12 | 13 | 84 14 | 15 | ProjectKSymbol 16 | 17 | 18 | OpenSansRegular 19 | Segoe UI 20 | Segoe UI 21 | 22 | 23 | 24 | OpenSansLight 25 | Segoe UI Light 26 | Segoe UI Light 27 | 28 | 29 | 33 | 39 | 40 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/BandCenter.Maui/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Maui; 2 | using Microsoft.Maui.Controls; 3 | using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; 4 | using Application = Microsoft.Maui.Controls.Application; 5 | 6 | namespace BandCenter.Maui 7 | { 8 | public partial class App : Application 9 | { 10 | public App() 11 | { 12 | InitializeComponent(); 13 | 14 | MainPage = new MainPage(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/BandCenter.Maui/BandCenter.Maui.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0-ios;net6.0-android;net6.0-maccatalyst 5 | $(TargetFrameworks);net6.0-windows10.0.19041 6 | Exe 7 | BandCenter.Maui 8 | true 9 | true 10 | true 11 | 12 | 13 | BandCenter.Maui 14 | 15 | 16 | com.companyname.BandCenter.Maui 17 | 18 | 19 | 1 20 | 21 | 22 | True 23 | 24 | 14.2 25 | 14.0 26 | 21.0 27 | 10.0.18362.0 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | MSBuild:Compile 57 | 58 | 59 | MSBuild:Compile 60 | 61 | 62 | 63 | 64 | WinExe 65 | win-x64 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/BandCenter.Maui/Controls/ActivityTile.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 12 | 13 | 14 | 18 | 21 | 25 | 29 | 30 | 31 | 32 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/BandCenter.Maui/Controls/ActivityTile.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace BandCenter.Maui.Controls 6 | { 7 | public partial class ActivityTile : ContentView 8 | { 9 | public ActivityTile() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | public static readonly BindableProperty SubtitleProperty = BindableProperty.Create( 15 | nameof(Subtitle), typeof(string), typeof(ActivityTile), string.Empty, propertyChanged: Subtitle_PropertyChanged); 16 | public string Subtitle 17 | { 18 | get => (string)GetValue(SubtitleProperty); 19 | set => SetValue(SubtitleProperty, value); 20 | } 21 | 22 | public static readonly BindableProperty MetricMarkupProperty = BindableProperty.Create( 23 | nameof(MetricMarkup), typeof(string), typeof(ActivityTile), string.Empty, propertyChanged: MetricMarkup_PropertyChanged); 24 | public string MetricMarkup 25 | { 26 | get => (string)GetValue(MetricMarkupProperty); 27 | set => SetValue(MetricMarkupProperty, value); 28 | } 29 | 30 | public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create( 31 | nameof(CommandParameter), typeof(object), typeof(ActivityTile), null); 32 | public object CommandParameter 33 | { 34 | get => GetValue(CommandParameterProperty); 35 | set => SetValue(CommandParameterProperty, value); 36 | } 37 | 38 | public static readonly BindableProperty CommandProperty = BindableProperty.Create( 39 | nameof(Command), typeof(ICommand), typeof(ActivityTile), null); 40 | public ICommand Command 41 | { 42 | get => (ICommand)GetValue(CommandProperty); 43 | set => SetValue(CommandProperty, value); 44 | } 45 | 46 | public static readonly BindableProperty IconSourceProperty = BindableProperty.Create( 47 | nameof(IconSource), typeof(ImageSource), typeof(ActivityTile), null, propertyChanged: IconSource_PropertyChanged); 48 | public ImageSource IconSource 49 | { 50 | get => (ImageSource)GetValue(IconSourceProperty); 51 | set => SetValue(IconSourceProperty, value); 52 | } 53 | 54 | private static void Subtitle_PropertyChanged(BindableObject bindable, object oldValue, object newValue) 55 | { 56 | // For some reason bindings just aren't working properly. ActivityTile gets the prop 57 | // changed event, but the Label never gets the new value. 58 | 59 | if (bindable is not ActivityTile tile) 60 | return; 61 | 62 | tile.SubtitleLabel.Text = newValue?.ToString(); 63 | } 64 | 65 | private static void MetricMarkup_PropertyChanged(BindableObject bindable, object oldValue, object newValue) 66 | { 67 | // For some reason bindings just aren't working properly. ActivityTile gets the prop 68 | // changed event, but the MetricMarkupPresenter never gets the new value. 69 | 70 | if (bindable is not ActivityTile tile) 71 | return; 72 | 73 | tile.MarkupPresenter.MetricMarkup = newValue?.ToString(); 74 | } 75 | 76 | private static void IconSource_PropertyChanged(BindableObject bindable, object oldValue, object newValue) 77 | { 78 | // For some reason bindings just aren't working properly. ActivityTile gets the prop 79 | // changed event, but the Image never gets the new value. 80 | 81 | if (bindable is not ActivityTile tile || newValue is not ImageSource source) 82 | return; 83 | 84 | tile.ImageElement.Source = source; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /src/BandCenter.Maui/Controls/MetricMarkupPresenter.xaml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /src/BandCenter.Maui/Controls/MetricMarkupPresenter.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.RegularExpressions; 5 | using Microsoft.Maui; 6 | using Microsoft.Maui.Controls; 7 | using Microsoft.Maui.Controls.Xaml; 8 | 9 | namespace BandCenter.Maui.Controls 10 | { 11 | public partial class MetricMarkupPresenter : ContentView 12 | { 13 | public MetricMarkupPresenter() 14 | { 15 | InitializeComponent(); 16 | } 17 | 18 | // TODO: Currently, the way markup is converted to TextBlocks requires that the markup 19 | // be completely reparsed when any of the styles change. It also means the markup property 20 | // has to be set after the style properties, otherwise the markup will be parsed once 21 | // without any styles, and an additional four times for each style. This is horribly 22 | // inefficient, and we should probably be using a style selector instead of a C# switch. 23 | 24 | #region Style properties 25 | 26 | public static readonly BindableProperty NoneTextStyleProperty = BindableProperty.Create( 27 | nameof(NoneTextStyle), typeof(Style), typeof(MetricMarkupPresenter), null, propertyChanged: Style_PropertyChanged); 28 | public Style NoneTextStyle 29 | { 30 | get => (Style)GetValue(NoneTextStyleProperty); 31 | set => SetValue(NoneTextStyleProperty, value); 32 | } 33 | 34 | public static readonly BindableProperty SmallTextStyleProperty = BindableProperty.Create( 35 | nameof(SmallTextStyle), typeof(Style), typeof(MetricMarkupPresenter), null, propertyChanged: Style_PropertyChanged); 36 | public Style SmallTextStyle 37 | { 38 | get => (Style)GetValue(SmallTextStyleProperty); 39 | set => SetValue(SmallTextStyleProperty, value); 40 | } 41 | 42 | public static readonly BindableProperty ItalicTextStyleProperty = BindableProperty.Create( 43 | nameof(ItalicTextStyle), typeof(Style), typeof(MetricMarkupPresenter), null, propertyChanged: Style_PropertyChanged); 44 | public Style ItalicTextStyle 45 | { 46 | get => (Style)GetValue(ItalicTextStyleProperty); 47 | set => SetValue(ItalicTextStyleProperty, value); 48 | } 49 | 50 | public static readonly BindableProperty BoldTextStyleProperty = BindableProperty.Create( 51 | nameof(BoldTextStyle), typeof(Style), typeof(MetricMarkupPresenter), null, propertyChanged: Style_PropertyChanged); 52 | public Style BoldTextStyle 53 | { 54 | get => (Style)GetValue(BoldTextStyleProperty); 55 | set => SetValue(BoldTextStyleProperty, value); 56 | } 57 | 58 | #endregion 59 | 60 | public static readonly BindableProperty MetricMarkupProperty = BindableProperty.Create( 61 | nameof(MetricMarkup), typeof(string), typeof(MetricMarkupPresenter), string.Empty, propertyChanged: MetricMarkup_PropertyChanged); 62 | public string MetricMarkup 63 | { 64 | get => (string)GetValue(MetricMarkupProperty); 65 | set => SetValue(MetricMarkupProperty, value); 66 | } 67 | 68 | private static void MetricMarkup_PropertyChanged(BindableObject bindable, object oldValue, object newValue) 69 | { 70 | if (oldValue == newValue || newValue is not string markup || bindable is not MetricMarkupPresenter presenter) 71 | return; 72 | 73 | UpdateMetricMarkup(presenter, markup); 74 | } 75 | 76 | private enum Format 77 | { 78 | None, Small, Italic, Bold 79 | } 80 | 81 | private void CommitMarkupSegment(string segment, Format format) 82 | { 83 | Span label = new() 84 | { 85 | Text = segment, 86 | Style = format switch 87 | { 88 | Format.Small => SmallTextStyle, 89 | Format.Italic => ItalicTextStyle, 90 | Format.Bold => BoldTextStyle, 91 | 92 | Format.None or 93 | _ => NoneTextStyle 94 | } 95 | }; 96 | TextContent.FormattedText.Spans.Add(label); 97 | } 98 | 99 | private static void Style_PropertyChanged(BindableObject bindable, object oldValue, object newValue) 100 | { 101 | var presenter = (MetricMarkupPresenter)bindable; 102 | UpdateMetricMarkup(presenter, presenter.MetricMarkup); 103 | } 104 | 105 | private static void UpdateMetricMarkup(MetricMarkupPresenter presenter, string markup) 106 | { 107 | presenter.TextContent.FormattedText.Spans.Clear(); 108 | 109 | if (string.IsNullOrEmpty(markup)) 110 | return; 111 | 112 | var matches = Regex.Matches(markup, @"<([nsib])>(.*?)<\/(?:\1)>"); 113 | if (matches.Count > 0) 114 | { 115 | //IList<(int idx, int len)> specialRanges = matches.OrderBy(m => m.Index).Select(m => (m.Index, m.Length)).ToList(); 116 | System.Text.StringBuilder curSegment = new(); 117 | int specialRangeIdx = 0; 118 | Match curSpecialRange = matches[specialRangeIdx]; 119 | for (int i = 0; i < markup.Length;) 120 | { 121 | if (curSpecialRange.Index == i) 122 | { 123 | // We're now in a marked up segment 124 | // Commit the previous segment 125 | if (curSegment != null) 126 | { 127 | presenter.CommitMarkupSegment(curSegment.ToString(), Format.None); 128 | curSegment.Clear(); 129 | } 130 | 131 | // Commit the marked up segment 132 | var format = matches[specialRangeIdx].Groups[1].Value switch 133 | { 134 | "n" => Format.None, 135 | "s" => Format.Small, 136 | "i" => Format.Italic, 137 | "b" => Format.Bold, 138 | _ => throw new FormatException($"Invalid format type.") 139 | }; 140 | presenter.CommitMarkupSegment(curSpecialRange.Groups[2].Value, format); 141 | // Jump to end of segment 142 | i += curSpecialRange.Length; 143 | 144 | // Select next markup segment 145 | if (++specialRangeIdx < matches.Count) 146 | curSpecialRange = matches[specialRangeIdx]; 147 | } 148 | else 149 | { 150 | // We're in a plain-text segment 151 | // Add character to current segment 152 | curSegment.Append(markup[i++]); 153 | } 154 | } 155 | 156 | // Make sure last segment is committed 157 | if (curSegment.Length > 0) 158 | { 159 | presenter.CommitMarkupSegment(curSegment.ToString(), Format.None); 160 | curSegment.Clear(); 161 | } 162 | } 163 | else 164 | { 165 | // No special markup 166 | presenter.CommitMarkupSegment(markup, Format.None); 167 | } 168 | 169 | // Ugly hack to make sure the Label updates 170 | presenter.TextContent.FormattedText = presenter.TextContent.FormattedText; 171 | } 172 | } 173 | } -------------------------------------------------------------------------------- /src/BandCenter.Maui/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |