Follow up Question: Label and Reference Equation inside Enumerate Environment

I have seen the answers to How can I center text/math inside a list environment. The accepted solution there, however, does not allow me to reference displayed equations. Another solution given there is a "crude" solution, requiring me to insert a command in each displayed equation.

Is there a way to modify the accepted solution to the above question so that displayed equations can be labelled and then referenced? (My MWE is similar to that presented in answer to linked Q)

If you're comfortable with the macro-use in How can I center text/math inside a list environment?, then you could use

\def\NLine$$#1$${\par\hspace*{-\leftmargin}\parbox{\textwidth}{$$#1$$}}


This inserts the argument inside a numbered math display and allows referencing in the usual way.

\documentclass{article}
\usepackage{amsmath,bm}% http://ctan.org/pkg/{amsmath,bm}
\def\MLine$$#1$${\par\hspace*{-\leftmargin}\parbox{\textwidth}{$$$#1$$$}}
\def\NLine$$#1$${\par\hspace*{-\leftmargin}\parbox{\textwidth}{$$#1$$}}
\begin{document}

\noindent\rule{\textwidth}{2pt}

\begin{itemize}
\MLine{x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}}
\item The freshman's dream
\MLine{(a+b)^n=a^n+b^n}
\item The freshman's dream
\NLine{(a+b)^n=a^n+b^n\label{xyz}}
\end{itemize}
See~\eqref{xyz}.

$(a+b)^n=a^n+b^n$

\end{document}


Perhaps a more intuitive definition might be

\makeatletter
\def\MLine{\par\hspace*{-\leftmargin}\@ifstar\MLineNoNum\MLineNum}
\def\MLineNoNum$$#1$${\parbox{\textwidth}{$$$#1$$$}}
\def\MLineNum$$#1$${\parbox{\textwidth}{$$#1$$}}
\makeatother


that allows you to use \MLine for numbered equations and \MLine* for unnumbered ones (mirroring other numbered/unnumbered environments/macros).