Ejemplo n.º 1
0
        public static string GetMoonXml(Moon moon, Sun sun)
        {
            double illumination = Astro.GetMoonPhase(moon, sun);
            var    result       = Astro.GetMoonPhase(illumination);

            return(@"
            <tile>
              <visual branding='nameAndLogo' displayName='" + App.res.GetString("Moon") + @"'>
                <binding template = 'TileSmall' >
                    <image src='Assets\tile-bg.png' placement='background'/>
                    <image src = '" + result.Item2 + @"' hint-removeMargin='true'/>
                </binding >

                <binding template='TileMedium'>
                  <image src='Assets\tile-bg.png' placement='background'/>
                  <group>
                    <subgroup hint-weight='1'>
                      <image src = '" + result.Item2 + @"' hint-removeMargin='true'/>
                    </subgroup>
                    <subgroup hint-weight='2' hint-textStacking='bottom'>
                      <text hint-align='center' hint-style='subtitle' >" + (moon.Result.NoDawn ? "--:--" : moon.Dawn.ToString("HH:mm")) + @"</text>
                      <text hint-align='center' hint-style='subtitle'>" + (moon.Result.NoDusk ? "--:--" : moon.Dusk.ToString("HH:mm")) + @"</text>
                    </subgroup>
                  </group>      
                </binding>

                <binding template = 'TileWide' >
                  <image src='Assets\tile-bg.png' placement='background'/>
                  <group >
                    <subgroup hint-weight='1'>
                      <image src = '" + result.Item2 + @"' hint-removeMargin='true'/>
                    </subgroup>
                    <subgroup hint-weight='3'>
                      <text hint-align='center' hint-style='title'>" + (moon.Result.NoDawn ? "--:--" : moon.Dawn.ToString("HH:mm")) + @"</text>
                      <text hint-align='center' hint-style='title'>" + (moon.Result.NoDusk ? "--:--" : moon.Dusk.ToString("HH:mm")) + @"</text>
                    </subgroup>
                  </group>
                </binding>

                <binding template = 'TileLarge' >
                  <image src='Assets\tile-bg.png' placement='background'/>
                  <group >
                    <subgroup hint-weight='1'></subgroup>
                    <subgroup hint-weight='2' >
                      <image src='" + result.Item2 + @"' />
                    </subgroup>
                    <subgroup hint-weight='1'></subgroup>
                  </group>
                      <text hint-align='center' hint-style='base'>" + App.res.GetString("MoonDailyDawnTimeTxt/Text") + (moon.Result.NoDawn ? "--:--" : moon.Dawn.ToString("HH:mm")) + @"</text>
                      <text hint-align='center' hint-style='base'>" + App.res.GetString("MoonDailyDuskTimeTxt/Text") + (moon.Result.NoDusk ? "--:--" : moon.Dusk.ToString("HH:mm")) + @"</text>
                </binding>
              </visual>
            </tile>
            ");
        }
Ejemplo n.º 2
0
        public PhaseItem(double illumination, int day, bool full_or_new)
        {
            DayNum = day;
            var result = Astro.GetMoonPhase(illumination);

            Asset = result.Item2;
            if (full_or_new)
            {
                Color = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 46, 63, 242));
            }
            else
            {
                Color = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 255, 255));
            }
        }